Jump to content
Poweramp

DulcetTone

Approved Members
  • Content Count

    7
  • Joined

  • Last visited

Everything posted by DulcetTone

  1. Can you offer me any direction in how to queue up and play music? I've had to mark your app as incompatible for the nicest features. I changed my code for playing a given album given its id to precisely the code you advise (see below). it does not queue up that album for play -- it appears to do nothing. startService(new Intent(PowerAMPiAPI.ACTION_API_COMMAND) .putExtra(PowerAMPiAPI.COMMAND, PowerAMPiAPI.Commands.OPEN_TO_PLAY) .setData(PowerAMPiAPI.ROOT_URI.buildUpon() .appendEncodedPath("albums") .appendEncodedPath(Long.toString(albumId)) .appendEncodedPath("files") .build()));
  2. Something is not working. First off, what you write above does not agree with the comments in the API file. The example you cite above: content://com.maxmpz.audioplayer.data/albums/55/files/22 is in the API file indicated as content://com.maxmpz.audioplayer/ALBUM/55/22 That is: no ".data" mentioned, "albums" is "ALBUM" (though there is a public static final String ALBUM = "album"), and the "/files" part is also not indicated. It's hard to guess my way to success. My app is a voice-driven one, and so I pause Poweramp playback the moment my app is invoked (which works fine). I then field a spoken command description of a set of songs to be played (or played in a shuffle mode) and then wish to ask Poweramp to play them. Whether I ask Poweramp to play 1. a given single song 2. a given artist's music -- all of it 3. a given album's music -- all of it 4. a given playlist -- all of it Poweramp simply resumes playing the playback that was paused at the start of the proceedings. I would like to have any previous music queueing context thrown out wholesale when I request any music such as the above basic flavors. Is the issue that I am asking Poweramp to play specific content while it is paused? Is the issue perhaps that I am both requesting this music and also specifying a shuffle mode in the same startService() call? tone tone
  3. I want to line up all the tracks by a given artist, and it does not seem to work. Here is my code. I am omitting a /media_id suffix, as I have zero interest in expressing a single track.. I want all the given artist's tracks to play. protected void _playArtist(long artist_id, boolean shuffle) { startService("playArtist(" + artist_id + ", " + shuffle + ")", new Intent(PowerAMPiAPI.ACTION_API_COMMAND) .putExtra(PowerAMPiAPI.COMMAND, PowerAMPiAPI.Commands.OPEN_TO_PLAY) .putExtra(PowerAMPiAPI.SHUFFLE, shuffle ? PowerAMPiAPI.ShuffleMode.SHUFFLE_CATS : PowerAMPiAPI.ShuffleMode.SHUFFLE_NONE) .setData(Uri.parse("content://com.maxmpz.audioplayer/ARTIST/" + artist_id)) ); // this does a TOGGLE_UNPAUSE if the music is already paused... // why is there no unconditional PLAY? Would RESUME do that? unpauseIfPaused(); showActivity(); } Second question... I take it that "cats" are categories, but what are categories? These seem to be concepts with no equivalents in other music apps, and my own UI is common to a variety of players. Thanks in advance. tone
  4. Thanks for that. FYI, the comment in the file indicates sendBroadcast is the way to go, which was the basis of my misunderstanding: /** * Poweramp Control action. * Should be sent with sendBroadcast(). * Extras: * - cmd - int - command to execute. */ public static final String ACTION_API_COMMAND = "com.maxmpz.audioplayer.API_COMMAND"; Thanks for publishing your API. tone
  5. This does not appear to have any effect on music playback. Am I using it incorrectly? void pausePowerAMP(Context context) { Intent intent = new Intent(PowerAMPiAPI.ACTION_API_COMMAND); intent.putExtra(PowerAMPiAPI.COMMAND, PowerAMPiAPI.Commands.PAUSE); context.sendBroadcast(intent); } tone
  6. I had added the library project as Project properties->Build Path->Project and was able to compile my code and run it (though it was not working fully). I went back and read your instructions that But this path of options does not appear to exist, or some detail is missing Can you please write out exactly where these options live in Eclipse? tone
  7. I have an app that works with many apps that all rely on the Android MediaStore. I see Poweramp supports that in addition to a more flexible storage model, but I want to start with the MediaStore support. I had database IDs for songs, artists, albums and playlists as longs. How do I prompt Poweramp to play a song (say) from the external SD card with a given database ID? I tried this, and get nothing to happen and Poweramp does not indicate anything in the logfile: protected void _playSong(Song song) { Uri uri = Uri.withAppendedPath( song.isInternal() ? MediaStore.Audio.Media.INTERNAL_CONTENT_URI : MediaStore.Audio.Media.EXTERNAL_CONTENT_URI , "" + song.mDatabaseId ); startService(new Intent(PowerAMPiAPI.ACTION_API_COMMAND) .putExtra(PowerAMPiAPI.COMMAND, PowerAMPiAPI.Commands.OPEN_TO_PLAY) .setData(uri) ); }
×
×
  • Create New...