2 * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com>
4 * This file is part of libquvi <http://quvi.sourceforge.net/>.
6 * This library is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public
8 * License as published by the Free Software Foundation, either
9 * version 3 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General
17 * Public License along with this library. If not, see
18 * <http://www.gnu.org/licenses/>.
21 /** @file subtitle_type_get.c */
30 #include "_quvi_subtitle_s.h"
32 static QuviError
_get(_quvi_subtitle_type_t qst
,
33 const QuviSubtitleTypeProperty n
, ...)
43 type
= QUVI_SUBTITLE_PROPERTY_TYPE_MASK
& (gint
) n
;
52 case QUVI_MEDIA_PROPERTY_TYPE_STRING
:
53 sp
= va_arg(arg
, gchar
**);
55 rc
= QUVI_ERROR_INVALID_ARG
;
58 case QUVI_MEDIA_PROPERTY_TYPE_LONG
:
59 lp
= va_arg(arg
, glong
*);
61 rc
= QUVI_ERROR_INVALID_ARG
;
64 case QUVI_MEDIA_PROPERTY_TYPE_DOUBLE
:
65 dp
= va_arg(arg
, gdouble
*);
67 rc
= QUVI_ERROR_INVALID_ARG
;
71 rc
= QUVI_ERROR_INVALID_ARG
;
82 * NOTE: Advances to the first item in the 'type' list if the
83 * current pointer is still set to NULL.
86 case QUVI_SUBTITLE_TYPE_PROPERTY_FORMAT
:
90 case QUVI_SUBTITLE_TYPE_PROPERTY_TYPE
:
95 rc
= QUVI_ERROR_INVALID_ARG
;
101 /** @brief Return a subtitle property
102 @sa @ref parse_subtitle
105 void quvi_subtitle_type_get(quvi_subtitle_type_t handle
,
106 QuviSubtitleTypeProperty n
, ...)
108 _quvi_subtitle_type_t qst
;
113 /* If G_DISABLE_CHECKS is defined then the check is not performed. */
114 g_return_if_fail(handle
!= NULL
);
117 p
= va_arg(arg
, gpointer
);
120 qst
= (_quvi_subtitle_type_t
) handle
;
121 q
= qst
->handle
.quvi
;
123 q
->status
.rc
= _get(qst
, n
, p
);
126 /* vim: set ts=2 sw=2 tw=72 expandtab: */