2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 /** @file script_next.c */
32 #define _W "libquvi: %s: %d"
36 /** @brief Traverse to next media script
37 @return QUVI_TRUE if succeeded, otherwise QUVI_FALSE
40 QuviBoolean
quvi_script_next(quvi_t handle
, QuviScriptType type
)
48 /* If G_DISABLE_CHECKS is defined then the check is not performed. */
49 g_return_val_if_fail(handle
!= NULL
, QUVI_FALSE
);
53 case QUVI_SCRIPT_TYPE_PLAYLIST
:
54 l
= q
->scripts
.playlist
;
59 g_warning(_W
, __func__
, (gint
) type
);
61 case QUVI_SCRIPT_TYPE_MEDIA
:
65 case QUVI_SCRIPT_TYPE_SCAN
:
74 case QUVI_SCRIPT_TYPE_PLAYLIST
:
75 q
->scripts
.curr
.playlist
= (q
->scripts
.curr
.playlist
!= NULL
)
76 ? g_slist_next(q
->scripts
.curr
.playlist
)
78 r
= (q
->scripts
.curr
.playlist
!= NULL
)
83 case QUVI_SCRIPT_TYPE_MEDIA
:
85 q
->scripts
.curr
.media
= (q
->scripts
.curr
.media
!= NULL
)
86 ? g_slist_next(q
->scripts
.curr
.media
)
88 r
= (q
->scripts
.curr
.media
!= NULL
)
93 case QUVI_SCRIPT_TYPE_SCAN
:
94 q
->scripts
.curr
.scan
= (q
->scripts
.curr
.scan
!= NULL
)
95 ? g_slist_next(q
->scripts
.curr
.scan
)
97 r
= (q
->scripts
.curr
.scan
!= NULL
)
108 /* vim: set ts=2 sw=2 tw=72 expandtab: */