예제 #1
0
static void activate_temp (void)
{
    gint playlists = playlist_count ();
    const gchar * title = _("Temporary Playlist");

    for (gint playlist = 0; playlist < playlists; playlist ++)
    {
        gchar * title2 = playlist_get_title (playlist);
        if (! strcmp (title2, title))
        {
            playlist_set_active (playlist);
            g_free (title2);
            return;
        }
        g_free (title2);
    }

    if (! playlist_entry_count (playlist_get_active ()))
        playlist_set_title (playlist_get_active (), title);
    else
    {
        playlist_insert (playlists);
        playlist_set_title (playlists, title);
        playlist_set_active (playlists);
    }
}
예제 #2
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;
}
예제 #3
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);
}
예제 #4
0
파일: drct.c 프로젝트: andkit/audacious
void drct_pl_prev (void)
{
    int playlist = playlist_get_playing ();
    if (playlist < 0)
        playlist = playlist_get_active ();

    playlist_prev_song (playlist);
}
예제 #5
0
파일: drct.c 프로젝트: andkit/audacious
void drct_pl_next (void)
{
    int playlist = playlist_get_playing ();
    if (playlist < 0)
        playlist = playlist_get_active ();

    playlist_next_song (playlist, get_bool (NULL, "repeat"));
}
예제 #6
0
파일: drct.c 프로젝트: i-tek/audacious
void drct_play (void)
{
    int playlist = playlist_get_playing ();
    if (playlist < 0)
        playlist = playlist_get_active ();

    drct_play_playlist (playlist);
}
예제 #7
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);
}
예제 #8
0
static void real_position(gint * playlist, gint * entry)
{
    if (*playlist == -2)
        *playlist = playlist_get_playing();
    if (*playlist == -1)
        *playlist = playlist_get_active();
    if (*entry == -1)
        *entry = playlist_get_position(*playlist);
}
예제 #9
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);
    }
}
예제 #10
0
파일: drct.c 프로젝트: i-tek/audacious
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);
    }
}
예제 #11
0
파일: drct.c 프로젝트: i-tek/audacious
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);
    }
}
예제 #12
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);
    }
}
예제 #13
0
void drct_play (void)
{
    if (drct_get_playing ())
    {
        if (drct_get_paused ())
            drct_pause ();
        else
        {
            int a, b;
            drct_get_ab_repeat (& a, & b);
            drct_seek (MAX (a, 0));
        }
    }
    else
        drct_play_playlist (playlist_get_active ());
}
예제 #14
0
static void add_list (Index * filenames, int at, bool_t to_temp, bool_t play)
{
    if (to_temp)
        playlist_set_active (playlist_get_temporary ());

    int playlist = playlist_get_active ();

    if (play)
    {
        if (get_bool (NULL, "clear_playlist"))
            playlist_entry_delete (playlist, 0, playlist_entry_count (playlist));
        else
            playlist_queue_delete (playlist, 0, playlist_queue_count (playlist));
    }

    playlist_entry_insert_batch (playlist, at, filenames, NULL, play);
}
예제 #15
0
파일: drct.c 프로젝트: andkit/audacious
static void add_list (Index * filenames, int at, bool_t to_temp, bool_t play)
{
    if (to_temp)
        playlist_set_active (playlist_get_temporary ());

    int playlist = playlist_get_active ();

    /* queue the new entries before deleting the old ones */
    /* this is to avoid triggering the --quit-after-play condition */
    playlist_entry_insert_batch (playlist, at, filenames, NULL, play);

    if (play)
    {
        if (get_bool (NULL, "clear_playlist"))
            playlist_entry_delete (playlist, 0, playlist_entry_count (playlist));
        else
            playlist_queue_delete (playlist, 0, playlist_queue_count (playlist));
    }
}
예제 #16
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;
}
예제 #17
0
static void add_list (GList * list, gint at, gboolean to_temp, gboolean play)
{
    if (to_temp)
        activate_temp ();

    gint playlist = playlist_get_active ();

    if (play)
    {
        if (get_bool (NULL, "clear_playlist"))
            playlist_entry_delete (playlist, 0, playlist_entry_count (playlist));
        else
            playlist_queue_delete (playlist, 0, playlist_queue_count (playlist));
    }

    struct index * filenames = index_new ();
    for (; list != NULL; list = list->next)
        index_append (filenames, g_strdup (list->data));

    playlist_entry_insert_batch (playlist, at, filenames, NULL, play);
}
예제 #18
0
void drct_pl_delete_selected (void)
{
    gint list = playlist_get_active ();
    gint 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);
}
예제 #19
0
gchar * drct_pl_get_file (gint entry)
{
    return playlist_entry_get_filename (playlist_get_active (), entry);
}
예제 #20
0
void drct_pq_remove (gint entry)
{
    gint playlist = playlist_get_active ();
    playlist_queue_delete (playlist, playlist_queue_find_entry (playlist,
     entry), 1);
}
예제 #21
0
void drct_pq_clear (void)
{
    gint playlist = playlist_get_active ();
    playlist_queue_delete (playlist, 0, playlist_queue_count (playlist));
}
예제 #22
0
gint drct_pq_get_queue_position (gint entry)
{
    return playlist_queue_find_entry (playlist_get_active (), entry);
}
예제 #23
0
void drct_pq_add (gint entry)
{
    playlist_queue_insert (playlist_get_active (), -1, entry);
}
예제 #24
0
gint drct_pq_get_length (void)
{
    return playlist_queue_count (playlist_get_active ());
}
예제 #25
0
gint drct_pq_get_entry (gint queue_position)
{
    return playlist_queue_get_entry (playlist_get_active (), queue_position);
}
예제 #26
0
void drct_pl_clear (void)
{
    gint playlist = playlist_get_active ();
    playlist_entry_delete (playlist, 0, playlist_entry_count (playlist));
}
예제 #27
0
gint drct_pl_get_pos (void)
{
    return playlist_get_position (playlist_get_active ());
}
예제 #28
0
void drct_pl_delete (gint entry)
{
    playlist_entry_delete (playlist_get_active (), entry, 1);
}
예제 #29
0
gchar * drct_pl_get_title (gint entry)
{
    return playlist_entry_get_title (playlist_get_active (), entry, FALSE);
}
예제 #30
0
gint drct_pl_get_time (gint pos)
{
    return playlist_entry_get_length (playlist_get_active (), pos, FALSE);
}