Ejemplo n.º 1
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.º 2
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.º 3
0
void effect_plugin_stop (PluginHandle * plugin)
{
    if (playback_get_playing ())
    {
        EffectPlugin * ep = plugin_get_header (plugin);
        g_return_if_fail (ep != NULL);
        effect_enable (plugin, ep, FALSE);
    }
}
Ejemplo n.º 4
0
static gboolean play_pause_cb(void *unused)
{
    if (playback_get_playing())
        playback_pause();
    else
        playback_play (0, FALSE);

    return FALSE;
}
Ejemplo n.º 5
0
bool_t effect_plugin_start (PluginHandle * plugin)
{
    if (playback_get_playing ())
    {
        EffectPlugin * ep = plugin_get_header (plugin);
        g_return_val_if_fail (ep != NULL, FALSE);
        effect_enable (plugin, ep, TRUE);
    }

    return TRUE;
}
Ejemplo n.º 6
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.º 7
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.º 8
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.º 9
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.º 10
0
static gboolean get_status_cb(void *data)
{
    struct StatusRequest *request = data;

    g_mutex_lock(info_mutex);

    memset (request, 0, sizeof (* request));
    request->playing = playback_get_playing();

    if (request->playing)
    {
        request->paused = playback_get_paused ();
        request->time = playback_get_time ();
        request->length = playback_get_length ();
        playback_get_info (& request->bitrate, & request->samplerate,
         & request->channels);
    }

    g_cond_signal(info_cond);
    g_mutex_unlock(info_mutex);
    return FALSE;
}
Ejemplo n.º 11
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.º 12
0
void drct_pl_delete_selected (int list)
{
    int pos = playlist_get_position (list);

    if (get_bool (NULL, "advance_on_delete")
     && ! get_bool (NULL, "no_playlist_advance")
     && playback_get_playing () && list == playlist_get_playing ()
     && pos >= 0 && playlist_entry_get_selected (list, pos))
    {
        playlist_entry_set_selected (list, pos, FALSE);
        playlist_delete_selected (list);
        pos = playlist_get_position (list); /* it may have moved */

        if (playlist_next_song (list, get_bool (NULL, "repeat"))
         && playlist_get_position (list) != pos)
            playback_play (0, FALSE);

        playlist_entry_delete (list, pos, 1);
    }
    else
        playlist_delete_selected (list);
}
Ejemplo n.º 13
0
gboolean drct_get_playing (void)
{
    return playback_get_playing ();
}
Ejemplo n.º 14
0
void drct_stop (void)
{
    if (playback_get_playing ())
        playback_stop ();
}
Ejemplo n.º 15
0
void drct_pause (void)
{
    if (playback_get_playing ())
        playback_pause ();
}