Ejemplo n.º 1
0
void drct_pl_next (void)
{
    gboolean play = playback_get_playing ();
    if (playlist_get_playing () < 0)
        playlist_set_playing (playlist_get_active ());
    if (playlist_next_song (playlist_get_playing (), get_bool (NULL, "repeat")) && play)
        playback_play (0, FALSE);
}
Ejemplo n.º 2
0
void drct_pl_prev (void)
{
    gboolean play = playback_get_playing ();
    if (playlist_get_playing () < 0)
        playlist_set_playing (playlist_get_active ());
    if (playlist_prev_song (playlist_get_playing ()) && play)
        playback_play (0, FALSE);
}
Ejemplo n.º 3
0
static gboolean play_cb(void *unused)
{
    /* Only the active playlist is visible through DBUS interface, so make sure
     * to play from it, not another playlist. --jlindgren */
    if (playlist_get_playing () != playlist_get_active ())
        playlist_set_playing (playlist_get_active ());

    drct_play();
    return FALSE;
}
Ejemplo n.º 4
0
void drct_pl_set_pos (gint pos)
{
    gint playlist = playlist_get_active ();
    gboolean play = playback_get_playing ();

    playlist_set_position (playlist, pos);

    if (play)
    {
        playlist_set_playing (playlist);
        playback_play (0, FALSE);
    }
}
Ejemplo n.º 5
0
void drct_pl_prev (void)
{
    bool_t play = playback_get_playing ();

    int playlist = playlist_get_playing ();
    if (playlist < 0)
        playlist = playlist_get_active ();

    if (playlist_prev_song (playlist) && play)
    {
        playlist_set_playing (playlist);
        playback_play (0, FALSE);
    }
}
Ejemplo n.º 6
0
void drct_pl_next (void)
{
    bool_t play = playback_get_playing ();

    int playlist = playlist_get_playing ();
    if (playlist < 0)
        playlist = playlist_get_active ();

    if (playlist_next_song (playlist, get_bool (NULL, "repeat")) && play)
    {
        playlist_set_playing (playlist);
        playback_play (0, FALSE);
    }
}
Ejemplo n.º 7
0
void drct_play (void)
{
    if (playback_get_playing ())
    {
        if (playback_get_paused ())
            playback_pause ();
        else
            playback_seek (0);
    }
    else
    {
        playlist_set_playing (playlist_get_active ());
        playback_play (0, FALSE);
    }
}
Ejemplo n.º 8
0
static gboolean add_cb(void *data)
{
    struct AddRequest *request = data;
    gint playlist = playlist_get_active();

    if (request->position < 0)
        request->position = playlist_entry_count (playlist);

    drct_pl_add (request->filename, request->position);

    if (request->play)
    {
        playlist_set_playing(playlist);
        playlist_set_position(playlist, request->position);
        playback_play (0, FALSE);
    }

    g_free(request);
    return FALSE;
}
Ejemplo n.º 9
0
void drct_play_playlist (int playlist)
{
    bool_t same_playlist = (playlist_get_playing () == playlist);

    if (! same_playlist)
        playlist_set_playing (playlist);

    if (playback_get_playing ())
    {
        if (playback_get_paused ())
            playback_pause ();
        else if (same_playlist)
            playback_seek (0);
    }
    else
    {
        if (playlist_get_position (playlist) < 0)
            playlist_next_song (playlist, TRUE);

        playback_play (0, FALSE);
    }
}
Ejemplo n.º 10
0
void drct_stop (void)
{
    playlist_set_playing (-1);
}
Ejemplo n.º 11
0
void drct_play_playlist (int playlist)
{
    playlist_set_playing (playlist);
    if (drct_get_paused ())
        drct_pause ();
}