public boolean isPlaying() { if (!(BASS.BASS_ACTIVE_PLAYING == BASS.BASS_ChannelIsActive(chan))) { stopForeground(true); stopUpdateProgress(); } if (BASS.BASS_ACTIVE_PLAYING == BASS.BASS_ChannelIsActive(chan)) { startUpdateProgress(); } return BASS.BASS_ACTIVE_PLAYING == BASS.BASS_ChannelIsActive(chan); }
@Override public void run() { if (BASS.BASS_ChannelIsActive(chan) == BASS.BASS_ACTIVE_PLAYING) { if (activity != null && activityStarted) { progress = BASS.BASS_ChannelBytes2Seconds( chan, BASS.BASS_ChannelGetPosition(chan, BASS.BASS_POS_BYTE)); activity.onProgressChanged(progress); } } timerHandler.postDelayed(this, 200); // looks like laggy timer on more then 200 values }
public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; if (row == null) { // ROW INFLATION LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); row = inflater.inflate(R.layout.mp3_list_item_layout, parent, false); } // Get item MP3Entity message = getItem(position); TextView messageArtistView = null; if (row != null) { messageArtistView = (TextView) row.findViewById(R.id.MP3artist); } SeekBar progressSeekBar = (SeekBar) row.findViewById(R.id.MP3SeekBar1); SeekBar volumeSeekBar = (SeekBar) row.findViewById(R.id.volumeSeekBar); messageArtistView.setText( message.getArtist() + " / " + message.getTime() + " / " + message.getTitle()); ImageButton deleteBtn = (ImageButton) row.findViewById(R.id.deleteMP3Button); HashMap<String, String> messageMap = new HashMap<String, String>(); messageMap.put("artist", message.getArtist()); messageMap.put("directory", message.getDirectory()); messageMap.put("time", message.getTime()); messageMap.put("title", message.getTitle()); deleteBtn.setTag(messageMap); deleteBtn.setOnClickListener(deleteCLickListener); ImageButton playBtn = (ImageButton) row.findViewById(R.id.MP3buttonPlay); playBtn.setTag(message); playBtn.setOnClickListener(playCLickListener); progressSeekBar.setTag(message.getDirectory()); volumeSeekBar.setTag(message.getDirectory() + "volume"); playBtn.setImageResource(R.drawable.play_states); if (message == PlayerState.getInstance().getCurrentMP3Entity()) { progressSeekBar.setVisibility(View.VISIBLE); volumeSeekBar.setVisibility(View.VISIBLE); CurrentControls.setCurrentMP3SeekBar(progressSeekBar); CurrentControls.setCurrentVolumeSeekBar(volumeSeekBar); if (!(BASS.BASS_ChannelIsActive(BASSUtil.getChan()) == BASS.BASS_ACTIVE_PAUSED)) playBtn.setImageResource(R.drawable.pause_states); } else { progressSeekBar.setVisibility(View.INVISIBLE); volumeSeekBar.setVisibility(View.INVISIBLE); volumeSeekBar.setVisibility(View.INVISIBLE); } return row; }
public boolean isPaused() { return BASS.BASS_ACTIVE_PAUSED == BASS.BASS_ChannelIsActive(chan); }