@girs/grl-0.1 0.1.0-3.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/grl-0.1.d.cts ADDED
@@ -0,0 +1,3465 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
7
+ */
8
+ /**
9
+ * Grl-0.1
10
+ */
11
+
12
+ import type GObject from '@girs/gobject-2.0';
13
+ import type GLib from '@girs/glib-2.0';
14
+ import type GModule from '@girs/gmodule-2.0';
15
+
16
+ /**
17
+ * These constants identify all the available core errors
18
+ */
19
+ export enum CoreError {
20
+ BROWSE_FAILED,
21
+ SEARCH_FAILED,
22
+ SEARCH_NULL_UNSUPPORTED,
23
+ QUERY_FAILED,
24
+ METADATA_FAILED,
25
+ RESOLVE_FAILED,
26
+ MEDIA_NOT_FOUND,
27
+ STORE_FAILED,
28
+ REMOVE_FAILED,
29
+ SET_METADATA_FAILED,
30
+ MEDIA_FROM_URI_FAILED,
31
+ CONFIG_LOAD_FAILED,
32
+ CONFIG_FAILED,
33
+ UNREGISTER_SOURCE_FAILED,
34
+ LOAD_PLUGIN_FAILED,
35
+ UNLOAD_PLUGIN_FAILED,
36
+ REGISTER_METADATA_KEY_FAILED,
37
+ NOTIFY_CHANGED_FAILED,
38
+ OPERATION_CANCELLED,
39
+ }
40
+ /**
41
+ * Grilo log levels. Defines the level of verbosity selected in Grilo.
42
+ */
43
+ export enum LogLevel {
44
+ NONE,
45
+ ERROR,
46
+ WARNING,
47
+ MESSAGE,
48
+ INFO,
49
+ DEBUG,
50
+ LAST,
51
+ }
52
+ /**
53
+ * GrlMedia serialize type
54
+ */
55
+ export enum MediaSerializeType {
56
+ BASIC,
57
+ PARTIAL,
58
+ FULL,
59
+ }
60
+ /**
61
+ * Specifies which kind of change has happened in the plugin
62
+ */
63
+ export enum MediaSourceChangeType {
64
+ CHANGED,
65
+ ADDED,
66
+ REMOVED,
67
+ }
68
+ /**
69
+ * Module priority ranks. Defines the order in which the resolver
70
+ * (or similar rank-picking mechanisms) will choose this plugin
71
+ * over an alternative one with the same function.
72
+ *
73
+ * These constants serve as a rough guidance for defining the rank
74
+ * of a GrlPluginInfo. Any value is valid, including values bigger
75
+ * than GRL_PLUGIN_RANK_HIGHEST.
76
+ */
77
+ export enum PluginRank {
78
+ LOWEST,
79
+ LOW,
80
+ DEFAULT,
81
+ HIGH,
82
+ HIGHEST,
83
+ }
84
+ /**
85
+ * GrlMetadata resolution flags
86
+ * @bitfield
87
+ */
88
+ export enum MetadataResolutionFlags {
89
+ NORMAL,
90
+ FULL,
91
+ IDLE_RELAY,
92
+ FAST_ONLY,
93
+ }
94
+ /**
95
+ * Flags for metadata writing operations.
96
+ * @bitfield
97
+ */
98
+ export enum MetadataWritingFlags {
99
+ NORMAL,
100
+ FULL,
101
+ }
102
+ /**
103
+ * Bitwise flags which reflect the kind of operations that a
104
+ * #GrlMediaPlugin supports.
105
+ * @bitfield
106
+ */
107
+ export enum SupportedOps {
108
+ NONE,
109
+ METADATA,
110
+ RESOLVE,
111
+ BROWSE,
112
+ SEARCH,
113
+ QUERY,
114
+ STORE,
115
+ STORE_PARENT,
116
+ REMOVE,
117
+ SET_METADATA,
118
+ MEDIA_FROM_URI,
119
+ NOTIFY_CHANGE,
120
+ }
121
+ export const CONFIG_KEY_APIKEY: string | null
122
+ export const CONFIG_KEY_APIKEY_BLOB: string | null
123
+ export const CONFIG_KEY_APISECRET: string | null
124
+ export const CONFIG_KEY_APITOKEN: string | null
125
+ export const CONFIG_KEY_PASSWORD: string | null
126
+ export const CONFIG_KEY_PLUGIN: string | null
127
+ export const CONFIG_KEY_SOURCE: string | null
128
+ export const CONFIG_KEY_USERNAME: string | null
129
+ export const KEYID_FORMAT: string | null
130
+ export const MEDIA_PLUGIN_AUTHOR: string | null
131
+ export const MEDIA_PLUGIN_DESCRIPTION: string | null
132
+ export const MEDIA_PLUGIN_LICENSE: string | null
133
+ export const MEDIA_PLUGIN_NAME: string | null
134
+ export const MEDIA_PLUGIN_SITE: string | null
135
+ export const MEDIA_PLUGIN_VERSION: string | null
136
+ export const METADATA_KEY_CHILDCOUNT_UNKNOWN: number
137
+ export const PADDING: number
138
+ export const PADDING_SMALL: number
139
+ export const PLUGIN_LIST_VAR: string | null
140
+ export const PLUGIN_PATH_VAR: string | null
141
+ export const PLUGIN_RANKS_VAR: string | null
142
+ export const SOURCE_REMAINING_UNKNOWN: number
143
+ /**
144
+ * Initializes the Grilo library
145
+ * @param argv list of arguments
146
+ */
147
+ export function init(argv?: string[] | null): /* argv */ string[] | null
148
+ /**
149
+ * Configure a set of log domains. The default configuration is to display
150
+ * warning and error messages only for all the log domains.
151
+ *
152
+ * The configuration string follows the following grammar:
153
+ *
154
+ *
155
+ * ```
156
+ * config-list: config | config ',' config-list
157
+ * config: domain ':' level
158
+ * domain: '*' | [a-zA-Z0-9]+
159
+ * level: '*' | '-' | named-level | num-level
160
+ * named-level: "none" | "error" | "warning" | "message" | "info" | "debug"
161
+ * num-level: [0-5]
162
+ * ```
163
+ *
164
+ *
165
+ * examples:
166
+ * <itemizedlist>
167
+ * <listitem><para>"*:*": maximum verbosity for all the log domains</para>
168
+ * </listitem>
169
+ * <listitem><para>"*:-": don't print any message</para></listitem>
170
+ * <listitem><para>"media-source:debug,metadata-source:debug": prints debug,
171
+ * info, message warning and error messages for the media-source and
172
+ * metadata-source log domains</para></listitem>
173
+ * </itemizedlist>
174
+ *
175
+ * <note>It's possible to override the log configuration at runtime by
176
+ * defining the GRL_DEBUG environment variable to a configuration string
177
+ * as described above</note>
178
+ * @param config A string describing the wanted log configuration
179
+ */
180
+ export function log_configure(config: string | null): void
181
+ export function marshal_VOID__BOXED_ENUM_BOOLEAN(closure: GObject.TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any, marshal_data: any): void
182
+ /**
183
+ * Retrieves the description associated with the key
184
+ * @param key key to look up
185
+ * @returns the description of the key
186
+ */
187
+ export function metadata_key_get_desc(key: GObject.ParamSpec): string | null
188
+ /**
189
+ * Retrieves the name associated with the key
190
+ * @param key key to look up
191
+ * @returns The name of the key
192
+ */
193
+ export function metadata_key_get_name(key: GObject.ParamSpec): string | null
194
+ export function metadata_key_setup_system_keys(registry: PluginRegistry): void
195
+ /**
196
+ * Cancel a running multiple search by issuing a cancel operation on each
197
+ * source involved involved in the operation.
198
+ * @param search_id the identifier of the multiple operation to cancel
199
+ */
200
+ export function multiple_cancel(search_id: number): void
201
+ /**
202
+ * Goes though all available media sources until it finds one capable of
203
+ * constructing a GrlMedia object representing the media resource exposed
204
+ * by `uri`.
205
+ *
206
+ * This method is asynchronous.
207
+ * @param uri A URI that can be used to identify a media resource
208
+ * @param keys List of metadata keys we want to obtain.
209
+ * @param flags the operation flags
210
+ * @param callback the user defined callback
211
+ */
212
+ export function multiple_get_media_from_uri(uri: string | null, keys: KeyID[], flags: MetadataResolutionFlags, callback: MediaSourceMetadataCb): void
213
+ /**
214
+ * Search for `text` in all the sources specified in `sources`.
215
+ *
216
+ * If `text` is `NULL` then NULL-text searchs will be used for each searchable
217
+ * plugin (see #grl_media_source_search for more details).
218
+ *
219
+ * This method is asynchronous.
220
+ * @param sources a #GList of #GrlMediaSource<!-- -->s to search from (%NULL for all searchable sources)
221
+ * @param text the text to search for
222
+ * @param keys the #GList of #GrlKeyID to retrieve
223
+ * @param count the maximum number of elements to retrieve
224
+ * @param flags the operation flags
225
+ * @param callback the user defined callback
226
+ * @returns the operation identifier
227
+ */
228
+ export function multiple_search(sources: MediaSource[] | null, text: string | null, keys: GObject.ParamSpec[], count: number, flags: MetadataResolutionFlags, callback: MediaSourceResultCb): number
229
+ /**
230
+ * Search for `text` in all the sources specified in `sources`.
231
+ *
232
+ * This method is synchronous.
233
+ * @param sources a #GList of #GrlMediaSource<!-- -->s where to search from (%NULL for all available sources with search capability)
234
+ * @param text the text to search for
235
+ * @param keys the #GList of #GrlKeyID to retrieve
236
+ * @param count the maximum number of elements to retrieve
237
+ * @param flags the operation flags
238
+ * @returns a list with #GrlMedia elements
239
+ */
240
+ export function multiple_search_sync(sources: MediaSource[] | null, text: string | null, keys: GObject.ParamSpec[], count: number, flags: MetadataResolutionFlags): Media[]
241
+ /**
242
+ * Cancel an operation.
243
+ * @param operation_id the identifier of a running operation
244
+ */
245
+ export function operation_cancel(operation_id: number): void
246
+ /**
247
+ * Obtains the previously attached data
248
+ * @param operation_id the identifier of a running operation
249
+ * @returns The previously attached data.
250
+ */
251
+ export function operation_get_data(operation_id: number): any
252
+ /**
253
+ * Attach a pointer to the specific operation.
254
+ * @param operation_id the identifier of a running operation
255
+ * @param user_data the data to attach
256
+ */
257
+ export function operation_set_data(operation_id: number, user_data: any): void
258
+ /**
259
+ * Grilo browsing implements a paging mechanism through `skip` and `count` values.
260
+ *
261
+ * But there are some services (like Jamendo or Flickr) where paging is done
262
+ * through a page number and page size: user request all elements in a page,
263
+ * specifying in most cases what is the page size.
264
+ *
265
+ * This function is a helper for this task, computing from `skip` and `count` what
266
+ * is the optimal value of page size (limited by `max_page_size)`, which page
267
+ * should the user request, and where requested data start inside the page.
268
+ *
269
+ * By optimal we mean that it computes those values so only one page is required
270
+ * to satisfy the data, using the smallest page size. If user is limiting page
271
+ * size, then more requests to services might be needed. But still page size
272
+ * will be an optimal value.
273
+ * @param skip number of elements to skip
274
+ * @param count number of elements to retrieve
275
+ * @param max_page_size maximum value for page size
276
+ * @param page_size optimal page size
277
+ * @param page_number page which contain the first element to retrieve (starting at 1)
278
+ * @param internal_offset in the `page_number,` offset where first element can be found (starting at 0)
279
+ */
280
+ export function paging_translate(skip: number, count: number, max_page_size: number, page_size: number, page_number: number, internal_offset: number): void
281
+ /**
282
+ * Prototype for the callback passed to grl_media_source_metadata()
283
+ * @callback
284
+ * @param source a media source
285
+ * @param operation_id operation identifier
286
+ * @param media a data transfer object
287
+ * @param error possible #GError generated at processing
288
+ */
289
+ export interface MediaSourceMetadataCb {
290
+ (source: MediaSource, operation_id: number, media: Media, error: number): void
291
+ }
292
+ /**
293
+ * Prototype for the callback passed to grl_media_source_remove()
294
+ * @callback
295
+ * @param source a media source
296
+ * @param media a data transfer object
297
+ * @param error possible #GError generated at processing
298
+ */
299
+ export interface MediaSourceRemoveCb {
300
+ (source: MediaSource, media: Media, error: number): void
301
+ }
302
+ /**
303
+ * Prototype for the callback passed to the media sources' methods
304
+ * @callback
305
+ * @param source a media source
306
+ * @param operation_id operation identifier
307
+ * @param media a data transfer object
308
+ * @param remaining the number of remaining #GrlMedia to process, or GRL_SOURCE_REMAINING_UNKNOWN if it is unknown
309
+ * @param error possible #GError generated at processing
310
+ */
311
+ export interface MediaSourceResultCb {
312
+ (source: MediaSource, operation_id: number, media: Media, remaining: number, error: number): void
313
+ }
314
+ /**
315
+ * Prototype for the callback passed to grl_media_source_store()
316
+ * @callback
317
+ * @param source a media source
318
+ * @param parent The #GrlMediaBox who parents the `media`
319
+ * @param media a data transfer object
320
+ * @param error possible #GError generated at processing
321
+ */
322
+ export interface MediaSourceStoreCb {
323
+ (source: MediaSource, parent: MediaBox, media: Media, error: number): void
324
+ }
325
+ /**
326
+ * Prototype for the callback passed to grl_metadata_source_resolve()
327
+ * @callback
328
+ * @param source a metadata source
329
+ * @param operation_id operation identifier
330
+ * @param media a #GrlMedia transfer object
331
+ * @param error possible #GError generated when resolving the metadata
332
+ */
333
+ export interface MetadataSourceResolveCb {
334
+ (source: MetadataSource, operation_id: number, media: Media, error: number): void
335
+ }
336
+ /**
337
+ * Prototype for the callback passed to grl_metadata_source_set_metadata()
338
+ * @callback
339
+ * @param source a metadata source
340
+ * @param media a #GrlMedia transfer object
341
+ * @param failed_keys #GList of keys that could not be updated, if any
342
+ * @param error possible #GError generated when updating the metadata
343
+ */
344
+ export interface MetadataSourceSetMetadataCb {
345
+ (source: MetadataSource, media: Media, failed_keys: GObject.ParamSpec[], error: number): void
346
+ }
347
+ export module Config {
348
+
349
+ // Constructor properties interface
350
+
351
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
352
+ }
353
+
354
+ }
355
+
356
+ export interface Config {
357
+
358
+ // Own fields of Grl-0.1.Grl.Config
359
+
360
+ parent: GObject.Object
361
+ priv: ConfigPrivate
362
+ _grl_reserved: any[]
363
+
364
+ // Owm methods of Grl-0.1.Grl.Config
365
+
366
+ get_api_key(): string | null
367
+ get_api_key_blob(size: number): number
368
+ get_api_secret(): string | null
369
+ get_api_token(): string | null
370
+ get_binary(param: string | null, size: number): number
371
+ get_boolean(param: string | null): boolean
372
+ get_float(param: string | null): number
373
+ get_int(param: string | null): number
374
+ get_password(): string | null
375
+ get_plugin(): string | null
376
+ get_string(param: string | null): string | null
377
+ get_username(): string | null
378
+ /**
379
+ * otherwise.
380
+ * @param param the param
381
+ * @returns TRUE if @params has a defined value within @config, FALSE
382
+ */
383
+ has_param(param: string | null): boolean
384
+ set(param: string | null, value: any): void
385
+ /**
386
+ * Set the webservice API key in the configuration
387
+ * @param key the API key
388
+ */
389
+ set_api_key(key: string | null): void
390
+ /**
391
+ * Set the binary API key in the configuration
392
+ * @param blob the binary API key blob
393
+ * @param size the size of the blob
394
+ */
395
+ set_api_key_blob(blob: number, size: number): void
396
+ /**
397
+ * Set the webservice passphrase in the configuration
398
+ * @param secret the webservice passphrase
399
+ */
400
+ set_api_secret(secret: string | null): void
401
+ /**
402
+ * Set the webservice API token in the configuration
403
+ * @param token the API token
404
+ */
405
+ set_api_token(token: string | null): void
406
+ set_binary(param: string | null, blob: number, size: number): void
407
+ set_boolean(param: string | null, value: boolean): void
408
+ set_float(param: string | null, value: number): void
409
+ set_int(param: string | null, value: number): void
410
+ /**
411
+ * Set the password in the configuration
412
+ * @param password the password
413
+ */
414
+ set_password(password: string | null): void
415
+ /**
416
+ * Set the plugin key in the configuration
417
+ * @param plugin the plugin id
418
+ */
419
+ set_plugin(plugin: string | null): void
420
+ /**
421
+ * Set the plugin key in the configuration
422
+ * @param source the source id
423
+ */
424
+ set_source(source: string | null): void
425
+ set_string(param: string | null, value: string | null): void
426
+ /**
427
+ * Set the username in the configuration
428
+ * @param username the username
429
+ */
430
+ set_username(username: string | null): void
431
+
432
+ // Class property signals of Grl-0.1.Grl.Config
433
+
434
+ connect(sigName: string, callback: (...args: any[]) => void): number
435
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
436
+ emit(sigName: string, ...args: any[]): void
437
+ disconnect(id: number): void
438
+ }
439
+
440
+ export class Config extends GObject.Object {
441
+
442
+ // Own properties of Grl-0.1.Grl.Config
443
+
444
+ static name: string
445
+ static $gtype: GObject.GType<Config>
446
+
447
+ // Constructors of Grl-0.1.Grl.Config
448
+
449
+ constructor(config?: Config.ConstructorProperties)
450
+ /**
451
+ * Creates a new data config object that will be associated with a plugin
452
+ * (if `source` is NULL), or a specific source spawned from a plugin (if
453
+ * `source` is not NULL). The latter may be useful for plugins
454
+ * spawning various sources, each one needing a different configuration.
455
+ *
456
+ * config associated with the plugin should not be freed until the plugin
457
+ * has been unloaded.
458
+ * @constructor
459
+ * @param plugin plugin id for this configuration
460
+ * @param source source id for this configuration
461
+ * @returns a newly-allocated data config. The data
462
+ */
463
+ constructor(plugin: string | null, source?: string | null)
464
+ /**
465
+ * Creates a new data config object that will be associated with a plugin
466
+ * (if `source` is NULL), or a specific source spawned from a plugin (if
467
+ * `source` is not NULL). The latter may be useful for plugins
468
+ * spawning various sources, each one needing a different configuration.
469
+ *
470
+ * config associated with the plugin should not be freed until the plugin
471
+ * has been unloaded.
472
+ * @constructor
473
+ * @param plugin plugin id for this configuration
474
+ * @param source source id for this configuration
475
+ * @returns a newly-allocated data config. The data
476
+ */
477
+ static new(plugin: string | null, source?: string | null): Config
478
+ _init(config?: Config.ConstructorProperties): void
479
+ }
480
+
481
+ export module Data {
482
+
483
+ // Constructor properties interface
484
+
485
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
486
+
487
+ // Own constructor properties of Grl-0.1.Grl.Data
488
+
489
+ overwrite?: boolean | null
490
+ }
491
+
492
+ }
493
+
494
+ export interface Data {
495
+
496
+ // Own properties of Grl-0.1.Grl.Data
497
+
498
+ overwrite: boolean
499
+
500
+ // Own fields of Grl-0.1.Grl.Data
501
+
502
+ parent: GObject.Object
503
+ priv: DataPrivate
504
+ _grl_reserved: any[]
505
+
506
+ // Owm methods of Grl-0.1.Grl.Data
507
+
508
+ /**
509
+ * Adds a new `key` to `data,` with no value. If key already exists, it does
510
+ * nothing.
511
+ * @param key key to add
512
+ */
513
+ add(key: GObject.ParamSpec): void
514
+ /**
515
+ * Appends a new binary value for `key` in `data`.
516
+ * @param key key to append
517
+ * @param buf the buffer containing the new value
518
+ * @param size size of buffer
519
+ */
520
+ add_binary(key: GObject.ParamSpec, buf: number, size: number): void
521
+ /**
522
+ * Appends a new float value for `key` in `data`.
523
+ * @param key key to append
524
+ * @param floatvalue the new value
525
+ */
526
+ add_float(key: GObject.ParamSpec, floatvalue: number): void
527
+ /**
528
+ * Appends a new int value for `key` in `data`.
529
+ * @param key key to append
530
+ * @param intvalue the new value
531
+ */
532
+ add_int(key: GObject.ParamSpec, intvalue: number): void
533
+ /**
534
+ * Adds a new set of values into `data`.
535
+ *
536
+ * All keys in `prop` must be related among them.
537
+ *
538
+ * `data` will take the ownership of `relkeys,` so do not modify it.
539
+ * @param relkeys a set of related properties with their values
540
+ */
541
+ add_related_keys(relkeys: RelatedKeys): void
542
+ /**
543
+ * Appends a new string value for `key` in `data`.
544
+ * @param key key to append
545
+ * @param strvalue the new value
546
+ */
547
+ add_string(key: GObject.ParamSpec, strvalue: string | null): void
548
+ /**
549
+ * Makes a deep copy of `data` and all its contents.
550
+ * @returns a new #GrlData. Free it with #g_object_unref.
551
+ */
552
+ dup(): Data
553
+ /**
554
+ * Get the first value from `data` associated with `key`.
555
+ *
556
+ * freed by user.
557
+ * @param key key to look up.
558
+ * @returns a #GValue. This value should not be modified nor
559
+ */
560
+ get(key: GObject.ParamSpec): any
561
+ /**
562
+ * Returns all non-%NULL values for `key` from `data`. This ignores related keys.
563
+ *
564
+ * values. Do not change or free the values. Free the list with #g_list_free.
565
+ * @param key a metadata key
566
+ * @returns a #GList with
567
+ */
568
+ get_all_single_related_keys(key: KeyID): any[]
569
+ /**
570
+ * Returns all non-%NULL values for `key` from `data`. `key` must have been
571
+ * registered as a string-type key. This ignores related keys.
572
+ *
573
+ * not change or free the strings. Free the list with #g_list_free.
574
+ * @param key a metadata key
575
+ * @returns a #GList with values. Do
576
+ */
577
+ get_all_single_related_keys_string(key: KeyID): string[]
578
+ /**
579
+ * Returns the first binary value associated with `key` from `data`. If `key` has
580
+ * no first value, or value is not a gfloat, or `key` is not in data, then %NULL
581
+ * is returned.
582
+ *
583
+ * successful `size` will be set the to the buffer size.
584
+ * @param key key to use
585
+ * @returns buffer location associated with the @key, or %NULL in other case. If
586
+ */
587
+ get_binary(key: GObject.ParamSpec): [ /* returnType */ number, /* size */ number ]
588
+ /**
589
+ * Returns the first float value associated with `key` from `data`. If `key` has no
590
+ * first value, or value is not a gfloat, or `key` is not in data, then 0 is
591
+ * returned.
592
+ * @param key key to use
593
+ * @returns float value associated with @key, or 0 in other case.
594
+ */
595
+ get_float(key: GObject.ParamSpec): number
596
+ /**
597
+ * Returns the first int value associated with `key` from `data`. If `key` has no
598
+ * first value, or value is not a gint, or `key` is not in data, then 0 is
599
+ * returned.
600
+ * @param key key to use
601
+ * @returns int value associated with @key, or 0 in other case.
602
+ */
603
+ get_int(key: GObject.ParamSpec): number
604
+ /**
605
+ * Returns a list with keys contained in `data`.
606
+ *
607
+ * keys. The content of the list should not be modified or freed. Use
608
+ * g_list_free() when done using the list.
609
+ * @returns an array with the
610
+ */
611
+ get_keys(): GObject.ParamSpec[]
612
+ /**
613
+ * Checks if old values are replaced when calling #grl_data_set.
614
+ * @returns %TRUE if values will be overwritten.
615
+ */
616
+ get_overwrite(): boolean
617
+ /**
618
+ * Returns a set containing the values for `key` and related keys at position
619
+ * `index` from `data`.
620
+ *
621
+ * If user changes any of the values in the related keys, the changes will
622
+ * become permanent.
623
+ * @param key a metadata key
624
+ * @param index element to retrieve, starting at 0
625
+ * @returns a #GrlRelatedKeys. Do not free it.
626
+ */
627
+ get_related_keys(key: KeyID, index: number): RelatedKeys
628
+ /**
629
+ * Returns all non-%NULL values for `key` from `data`. This ignores related keys.
630
+ *
631
+ * values. Do not change or free the values. Free the list with #g_list_free.
632
+ * @param key a metadata key
633
+ * @returns a #GList with
634
+ */
635
+ get_single_values_for_key(key: KeyID): any[]
636
+ /**
637
+ * Returns all non-%NULL values for `key` from `data`. `key` must have been
638
+ * registered as a string-type key. This ignores related keys.
639
+ *
640
+ * not change or free the strings. Free the list with #g_list_free.
641
+ * @param key a metadata key
642
+ * @returns a #GList with values. Do
643
+ */
644
+ get_single_values_for_key_string(key: KeyID): string[]
645
+ /**
646
+ * Returns the first string value associated with `key` from `data`. If `key` has
647
+ * no first value, or value is not string, or `key` is not in `data,` then %NULL
648
+ * is returned.
649
+ *
650
+ * not change nor free the value.
651
+ * @param key key to use
652
+ * @returns string associated with @key, or %NULL in other case. Caller should
653
+ */
654
+ get_string(key: GObject.ParamSpec): string | null
655
+ /**
656
+ * Checks if `key` is in `data`.
657
+ * @param key key to search
658
+ * @returns %TRUE if @key is in @data, %FALSE in other case.
659
+ */
660
+ has_key(key: GObject.ParamSpec): boolean
661
+ /**
662
+ * Checks if the `key` has a first value in `data`.
663
+ * @param key key to search
664
+ * @returns %TRUE if key has a value.
665
+ */
666
+ key_is_known(key: GObject.ParamSpec): boolean
667
+ /**
668
+ * Returns how many values `key` or related keys have in `data:` if `key` has no
669
+ * value, but a related key has, then it is counted as positive.
670
+ *
671
+ * As example, let's think in three related keys, K1, K2 and K3, and then thinks
672
+ * we have added several values for those keys, as:
673
+ *
674
+ * (V10, V20, V30),, (V11, NULL, V31), (V12, NULL, V32)
675
+ *
676
+ * Therefore, when invoking grl_data_length (data, K2) it will return 3:
677
+ * considering K2 and the related keys (K1 and K3), there are 3 values.
678
+ * @param key a metadata key
679
+ * @returns number of values
680
+ */
681
+ length(key: KeyID): number
682
+ /**
683
+ * Removes the first value for `key` from `data`. If there are other keys related
684
+ * to `key` their values will also be removed from `data`.
685
+ * @param key key to remove
686
+ */
687
+ remove(key: GObject.ParamSpec): void
688
+ /**
689
+ * Removes the value at position `index` for `key` from `data`. If there are other
690
+ * keys related to `key,` their values at position `index` will also be removed
691
+ * from `data`.
692
+ * @param key a metadata key
693
+ * @param index index of key to be removed, starting at 0
694
+ */
695
+ remove_nth(key: KeyID, index: number): void
696
+ /**
697
+ * Sets the first value associated with `key` in `data`. If key already has a
698
+ * value old value is freed and the new one is set.
699
+ *
700
+ * Also, checks that `value` is compliant with `key` specification, modifying it
701
+ * accordingly. For instance, if `key` requires a number between 0 and 10, but
702
+ * `value` is outside this range, it will be adapted accordingly.
703
+ * @param key key to change or add
704
+ * @param value the new value
705
+ */
706
+ set(key: GObject.ParamSpec, value: any): void
707
+ /**
708
+ * Sets the first binary value associated with `key` in `data`. If `key` already
709
+ * has a first value old value is replaced by the new one.
710
+ * @param key key to change or add
711
+ * @param buf buffer holding the data
712
+ * @param size size of the buffer
713
+ */
714
+ set_binary(key: GObject.ParamSpec, buf: number, size: number): void
715
+ /**
716
+ * Sets the first float value associated with `key` in `data`. If `key` already has
717
+ * a first value old value is replaced by the new one.
718
+ * @param key key to change or add
719
+ * @param floatvalue the new value
720
+ */
721
+ set_float(key: GObject.ParamSpec, floatvalue: number): void
722
+ /**
723
+ * Sets the first int value associated with `key` in `data`. If `key` already has a
724
+ * first value old value is replaced by the new one.
725
+ * @param key key to change or add
726
+ * @param intvalue the new value
727
+ */
728
+ set_int(key: GObject.ParamSpec, intvalue: number): void
729
+ /**
730
+ * This controls if #grl_data_set will overwrite the current value of a property
731
+ * with the new one.
732
+ *
733
+ * Set it to %TRUE so old values are overwritten, or %FALSE in other case
734
+ * (default is %FALSE).
735
+ * @param overwrite if data can be overwritten
736
+ */
737
+ set_overwrite(overwrite: boolean): void
738
+ /**
739
+ * Updates the values at position `index` in `data` with values in `relkeys`.
740
+ *
741
+ * `data` will take ownership of `relkeys,` so do not free it after invoking this
742
+ * function.
743
+ * @param relkeys a set of related keys
744
+ * @param index position to be updated, starting at 0
745
+ */
746
+ set_related_keys(relkeys: RelatedKeys, index: number): void
747
+ /**
748
+ * Sets the first string value associated with `key` in `data`. If `key` already
749
+ * has a value old value is freed and the new one is set.
750
+ * @param key key to change or add
751
+ * @param strvalue the new value
752
+ */
753
+ set_string(key: GObject.ParamSpec, strvalue: string | null): void
754
+
755
+ // Class property signals of Grl-0.1.Grl.Data
756
+
757
+ connect(sigName: "notify::overwrite", callback: (($obj: Data, pspec: GObject.ParamSpec) => void)): number
758
+ connect_after(sigName: "notify::overwrite", callback: (($obj: Data, pspec: GObject.ParamSpec) => void)): number
759
+ emit(sigName: "notify::overwrite", ...args: any[]): void
760
+ connect(sigName: string, callback: (...args: any[]) => void): number
761
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
762
+ emit(sigName: string, ...args: any[]): void
763
+ disconnect(id: number): void
764
+ }
765
+
766
+ export class Data extends GObject.Object {
767
+
768
+ // Own properties of Grl-0.1.Grl.Data
769
+
770
+ static name: string
771
+ static $gtype: GObject.GType<Data>
772
+
773
+ // Constructors of Grl-0.1.Grl.Data
774
+
775
+ constructor(config?: Data.ConstructorProperties)
776
+ /**
777
+ * Creates a new data object.
778
+ * @constructor
779
+ * @returns a new data object.
780
+ */
781
+ constructor()
782
+ /**
783
+ * Creates a new data object.
784
+ * @constructor
785
+ * @returns a new data object.
786
+ */
787
+ static new(): Data
788
+ _init(config?: Data.ConstructorProperties): void
789
+ }
790
+
791
+ export module Media {
792
+
793
+ // Constructor properties interface
794
+
795
+ export interface ConstructorProperties extends Data.ConstructorProperties {
796
+ }
797
+
798
+ }
799
+
800
+ export interface Media {
801
+
802
+ // Own fields of Grl-0.1.Grl.Media
803
+
804
+ parent: Data & GObject.Object
805
+
806
+ // Owm methods of Grl-0.1.Grl.Media
807
+
808
+ /**
809
+ * Adds a new author to `media`.
810
+ * @param author an author for `media`
811
+ */
812
+ add_author(author: string | null): void
813
+ /**
814
+ * Adds a new external player to `media`.
815
+ * @param player an external player for `media`
816
+ */
817
+ add_external_player(player: string | null): void
818
+ /**
819
+ * Adds a new external url to `media`.
820
+ * @param url an external url for `media`
821
+ */
822
+ add_external_url(url: string | null): void
823
+ /**
824
+ * Adds a new thumbnail to `media`.
825
+ * @param thumbnail a thumbnail for `media`
826
+ */
827
+ add_thumbnail(thumbnail: string | null): void
828
+ /**
829
+ * Adds a new thumbnail to `media`.
830
+ * @param thumbnail a buffer containing the thumbnail for `media`
831
+ * @param size size of buffer
832
+ */
833
+ add_thumbnail_binary(thumbnail: number, size: number): void
834
+ /**
835
+ * Adds a new media's URL with its mime-type.
836
+ * @param url a media's URL
837
+ * @param mime th `url` mime type
838
+ */
839
+ add_url_data(url: string | null, mime: string | null): void
840
+ get_author(): string | null
841
+ get_author_nth(index: number): string | null
842
+ get_certificate(): string | null
843
+ get_creation_date(): string | null
844
+ get_date(): string | null
845
+ get_description(): string | null
846
+ get_duration(): number
847
+ /**
848
+ * where the user play the media.
849
+ * @returns URL of an external location
850
+ */
851
+ get_external_url(): string | null
852
+ get_external_url_nth(index: number): string | null
853
+ get_id(): string | null
854
+ get_last_played(): string | null
855
+ get_last_position(): number
856
+ get_license(): string | null
857
+ get_mime(): string | null
858
+ get_play_count(): number
859
+ /**
860
+ * object for this media
861
+ * @returns URL of an external player
862
+ */
863
+ get_player(): string | null
864
+ get_player_nth(index: number): string | null
865
+ get_rating(): number
866
+ get_site(): string | null
867
+ get_source(): string | null
868
+ get_studio(): string | null
869
+ get_thumbnail(): string | null
870
+ get_thumbnail_binary(size: number): number
871
+ /**
872
+ * buffer size.
873
+ * @param size pointer to store the thumbnail buffer size
874
+ * @param index element to retrieve
875
+ * @returns the n-th media's thumbnail binary and sets size to the thumbnail
876
+ */
877
+ get_thumbnail_binary_nth(size: number, index: number): number
878
+ get_thumbnail_nth(index: number): string | null
879
+ get_title(): string | null
880
+ get_url(): string | null
881
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
882
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
883
+ /**
884
+ * Serializes a GrlMedia into a string. It does a basic serialization.
885
+ *
886
+ * See grl_media_serialize_extended() to get more serialization approaches.
887
+ * @returns serialized media
888
+ */
889
+ serialize(): string | null
890
+ /**
891
+ * Set the media's author
892
+ * @param author the media's author
893
+ */
894
+ set_author(author: string | null): void
895
+ /**
896
+ * Set the media certificate
897
+ * @param certificate The rating certificate of the media
898
+ */
899
+ set_certificate(certificate: string | null): void
900
+ /**
901
+ * Set the creation_date of the media
902
+ * @param creation_date date when media was created
903
+ */
904
+ set_creation_date(creation_date: string | null): void
905
+ /**
906
+ * Set the media's date (TBD)
907
+ * @param date the date
908
+ */
909
+ set_date(date: string | null): void
910
+ /**
911
+ * Set the media's description
912
+ * @param description the description
913
+ */
914
+ set_description(description: string | null): void
915
+ /**
916
+ * Set the media's duration
917
+ * @param duration the duration
918
+ */
919
+ set_duration(duration: number): void
920
+ /**
921
+ * Set the location of a player for the media (usually a flash player)
922
+ * @param player location of an external player for this media
923
+ */
924
+ set_external_player(player: string | null): void
925
+ /**
926
+ * Set an external location where users can play the media
927
+ * @param url external location where this media can be played.
928
+ */
929
+ set_external_url(url: string | null): void
930
+ /**
931
+ * Set the media identifier
932
+ * @param id the identifier of the media
933
+ */
934
+ set_id(id: string | null): void
935
+ /**
936
+ * Set the media last played date
937
+ * @param last_played date when the media was last played
938
+ */
939
+ set_last_played(last_played: string | null): void
940
+ /**
941
+ * Set the media last played position
942
+ * @param last_position second at which the media playback was interrupted
943
+ */
944
+ set_last_position(last_position: number): void
945
+ /**
946
+ * Set the media license
947
+ * @param license The license of the media
948
+ */
949
+ set_license(license: string | null): void
950
+ /**
951
+ * Set the media's mime-type
952
+ * @param mime the mime type
953
+ */
954
+ set_mime(mime: string | null): void
955
+ /**
956
+ * Set the media play count
957
+ * @param play_count the play count
958
+ */
959
+ set_play_count(play_count: number): void
960
+ /**
961
+ * This method receives a rating and its scale and normalizes it
962
+ * @param rating a rating value
963
+ * @param max maximum rating value
964
+ */
965
+ set_rating(rating: number, max: number): void
966
+ /**
967
+ * Set the media's site
968
+ * @param site the site
969
+ */
970
+ set_site(site: string | null): void
971
+ /**
972
+ * Set the media's source
973
+ * @param source the source
974
+ */
975
+ set_source(source: string | null): void
976
+ /**
977
+ * Set the media studio
978
+ * @param studio The studio the media is from
979
+ */
980
+ set_studio(studio: string | null): void
981
+ /**
982
+ * Set the media's thumbnail URL
983
+ * @param thumbnail the thumbnail URL
984
+ */
985
+ set_thumbnail(thumbnail: string | null): void
986
+ /**
987
+ * Set the media's binary thumbnail
988
+ * @param thumbnail thumbnail buffer
989
+ * @param size thumbnail buffer size
990
+ */
991
+ set_thumbnail_binary(thumbnail: number, size: number): void
992
+ /**
993
+ * Set the media's title
994
+ * @param title the title
995
+ */
996
+ set_title(title: string | null): void
997
+ /**
998
+ * Set the media's URL
999
+ * @param url the media's URL
1000
+ */
1001
+ set_url(url: string | null): void
1002
+ /**
1003
+ * Set the media's URL and its mime-type.
1004
+ * @param url the media's URL
1005
+ * @param mime the `url` mime type
1006
+ */
1007
+ set_url_data(url: string | null, mime: string | null): void
1008
+
1009
+ // Class property signals of Grl-0.1.Grl.Media
1010
+
1011
+ connect(sigName: "notify::overwrite", callback: (($obj: Media, pspec: GObject.ParamSpec) => void)): number
1012
+ connect_after(sigName: "notify::overwrite", callback: (($obj: Media, pspec: GObject.ParamSpec) => void)): number
1013
+ emit(sigName: "notify::overwrite", ...args: any[]): void
1014
+ connect(sigName: string, callback: (...args: any[]) => void): number
1015
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1016
+ emit(sigName: string, ...args: any[]): void
1017
+ disconnect(id: number): void
1018
+ }
1019
+
1020
+ export class Media extends Data {
1021
+
1022
+ // Own properties of Grl-0.1.Grl.Media
1023
+
1024
+ static name: string
1025
+ static $gtype: GObject.GType<Media>
1026
+
1027
+ // Constructors of Grl-0.1.Grl.Media
1028
+
1029
+ constructor(config?: Media.ConstructorProperties)
1030
+ /**
1031
+ * Creates a new data media object.
1032
+ * @constructor
1033
+ * @returns a newly-allocated data media.
1034
+ */
1035
+ constructor()
1036
+ /**
1037
+ * Creates a new data media object.
1038
+ * @constructor
1039
+ * @returns a newly-allocated data media.
1040
+ */
1041
+ static new(): Media
1042
+
1043
+ // Overloads of new
1044
+
1045
+ /**
1046
+ * Creates a new data object.
1047
+ * @constructor
1048
+ * @returns a new data object.
1049
+ */
1050
+ static new(): Data
1051
+ _init(config?: Media.ConstructorProperties): void
1052
+ /**
1053
+ * Unserializes a GrlMedia.
1054
+ * @param serial a serialized media
1055
+ * @returns the GrlMedia from the serial
1056
+ */
1057
+ static unserialize(serial: string | null): Media
1058
+ }
1059
+
1060
+ export module MediaAudio {
1061
+
1062
+ // Constructor properties interface
1063
+
1064
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1065
+ }
1066
+
1067
+ }
1068
+
1069
+ export interface MediaAudio {
1070
+
1071
+ // Own fields of Grl-0.1.Grl.MediaAudio
1072
+
1073
+ parent: Media & Data & GObject.Object & GObject.Object
1074
+
1075
+ // Owm methods of Grl-0.1.Grl.MediaAudio
1076
+
1077
+ /**
1078
+ * Adds a new artist to `audio`.
1079
+ * @param artist an audio's artist
1080
+ */
1081
+ add_artist(artist: string | null): void
1082
+ /**
1083
+ * Adds a new genre to `audio`.
1084
+ * @param genre an audio's genre
1085
+ */
1086
+ add_genre(genre: string | null): void
1087
+ /**
1088
+ * Adds a new lyrics to `audio`.
1089
+ * @param lyrics an audio's lyrics
1090
+ */
1091
+ add_lyrics(lyrics: string | null): void
1092
+ /**
1093
+ * Sets all the keys related with the URL of a media resource and adds it to
1094
+ * `audio` (useful for resources with more than one URL).
1095
+ * @param url an audio's url
1096
+ * @param mime the `url` mime-type
1097
+ * @param bitrate the `url` bitrate, or -1 to ignore
1098
+ */
1099
+ add_url_data(url: string | null, mime: string | null, bitrate: number): void
1100
+
1101
+ // Overloads of add_url_data
1102
+
1103
+ /**
1104
+ * Adds a new media's URL with its mime-type.
1105
+ * @param url a media's URL
1106
+ * @param mime th `url` mime type
1107
+ */
1108
+ add_url_data(url: string | null, mime: string | null): void
1109
+ get_album(): string | null
1110
+ get_artist(): string | null
1111
+ get_artist_nth(index: number): string | null
1112
+ get_bitrate(): number
1113
+ get_genre(): string | null
1114
+ get_genre_nth(index: number): string | null
1115
+ get_lyrics(): string | null
1116
+ get_lyrics_nth(index: number): string | null
1117
+ get_track_number(): number
1118
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null, /* bitrate */ number ]
1119
+
1120
+ // Overloads of get_url_data
1121
+
1122
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1123
+ /**
1124
+ * in one go.
1125
+ * @param index element to retrieve, starting at 0
1126
+ * @returns all the keys related with the URL number @index of an audio resource
1127
+ */
1128
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null, /* bitrate */ number ]
1129
+
1130
+ // Overloads of get_url_data_nth
1131
+
1132
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1133
+ /**
1134
+ * Set the album of the audio
1135
+ * @param album the audio's album
1136
+ */
1137
+ set_album(album: string | null): void
1138
+ /**
1139
+ * Set the artist of the audio
1140
+ * @param artist the audio's artist
1141
+ */
1142
+ set_artist(artist: string | null): void
1143
+ /**
1144
+ * Set the bitrate of the audio
1145
+ * @param bitrate the audio's bitrate
1146
+ */
1147
+ set_bitrate(bitrate: number): void
1148
+ /**
1149
+ * Set the genre of the audio
1150
+ * @param genre the audio's genre
1151
+ */
1152
+ set_genre(genre: string | null): void
1153
+ /**
1154
+ * Set the lyrics of the audio
1155
+ * @param lyrics the audio's lyrics
1156
+ */
1157
+ set_lyrics(lyrics: string | null): void
1158
+ /**
1159
+ * Set the track number of the audio
1160
+ * @param track_number the audio's track number
1161
+ */
1162
+ set_track_number(track_number: number): void
1163
+ /**
1164
+ * Sets all the keys related with the URL of an audio resource in one go.
1165
+ * @param url the audio's url
1166
+ * @param mime the `url` mime-type
1167
+ * @param bitrate the `url` bitrate, or -1 to ignore
1168
+ */
1169
+ set_url_data(url: string | null, mime: string | null, bitrate: number): void
1170
+
1171
+ // Overloads of set_url_data
1172
+
1173
+ /**
1174
+ * Set the media's URL and its mime-type.
1175
+ * @param url the media's URL
1176
+ * @param mime the `url` mime type
1177
+ */
1178
+ set_url_data(url: string | null, mime: string | null): void
1179
+
1180
+ // Class property signals of Grl-0.1.Grl.MediaAudio
1181
+
1182
+ connect(sigName: "notify::overwrite", callback: (($obj: MediaAudio, pspec: GObject.ParamSpec) => void)): number
1183
+ connect_after(sigName: "notify::overwrite", callback: (($obj: MediaAudio, pspec: GObject.ParamSpec) => void)): number
1184
+ emit(sigName: "notify::overwrite", ...args: any[]): void
1185
+ connect(sigName: string, callback: (...args: any[]) => void): number
1186
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1187
+ emit(sigName: string, ...args: any[]): void
1188
+ disconnect(id: number): void
1189
+ }
1190
+
1191
+ export class MediaAudio extends Media {
1192
+
1193
+ // Own properties of Grl-0.1.Grl.MediaAudio
1194
+
1195
+ static name: string
1196
+ static $gtype: GObject.GType<MediaAudio>
1197
+
1198
+ // Constructors of Grl-0.1.Grl.MediaAudio
1199
+
1200
+ constructor(config?: MediaAudio.ConstructorProperties)
1201
+ /**
1202
+ * Creates a new data audio object.
1203
+ * @constructor
1204
+ * @returns a newly-allocated data audio.
1205
+ */
1206
+ constructor()
1207
+ /**
1208
+ * Creates a new data audio object.
1209
+ * @constructor
1210
+ * @returns a newly-allocated data audio.
1211
+ */
1212
+ static new(): MediaAudio
1213
+
1214
+ // Overloads of new
1215
+
1216
+ /**
1217
+ * Creates a new data media object.
1218
+ * @constructor
1219
+ * @returns a newly-allocated data media.
1220
+ */
1221
+ static new(): Media
1222
+ /**
1223
+ * Creates a new data object.
1224
+ * @constructor
1225
+ * @returns a new data object.
1226
+ */
1227
+ static new(): Data
1228
+ _init(config?: MediaAudio.ConstructorProperties): void
1229
+ }
1230
+
1231
+ export module MediaBox {
1232
+
1233
+ // Constructor properties interface
1234
+
1235
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1236
+ }
1237
+
1238
+ }
1239
+
1240
+ export interface MediaBox {
1241
+
1242
+ // Own fields of Grl-0.1.Grl.MediaBox
1243
+
1244
+ parent: Media & Data & GObject.Object & GObject.Object
1245
+
1246
+ // Owm methods of Grl-0.1.Grl.MediaBox
1247
+
1248
+ /**
1249
+ * Number of children of this box.
1250
+ *
1251
+ * unknown.
1252
+ * @returns number of children, or #GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN if
1253
+ */
1254
+ get_childcount(): number
1255
+ /**
1256
+ * Sets the number of children of this box. Use
1257
+ * #GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN if it is unknown.
1258
+ * @param childcount number of children
1259
+ */
1260
+ set_childcount(childcount: number): void
1261
+
1262
+ // Class property signals of Grl-0.1.Grl.MediaBox
1263
+
1264
+ connect(sigName: "notify::overwrite", callback: (($obj: MediaBox, pspec: GObject.ParamSpec) => void)): number
1265
+ connect_after(sigName: "notify::overwrite", callback: (($obj: MediaBox, pspec: GObject.ParamSpec) => void)): number
1266
+ emit(sigName: "notify::overwrite", ...args: any[]): void
1267
+ connect(sigName: string, callback: (...args: any[]) => void): number
1268
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1269
+ emit(sigName: string, ...args: any[]): void
1270
+ disconnect(id: number): void
1271
+ }
1272
+
1273
+ export class MediaBox extends Media {
1274
+
1275
+ // Own properties of Grl-0.1.Grl.MediaBox
1276
+
1277
+ static name: string
1278
+ static $gtype: GObject.GType<MediaBox>
1279
+
1280
+ // Constructors of Grl-0.1.Grl.MediaBox
1281
+
1282
+ constructor(config?: MediaBox.ConstructorProperties)
1283
+ /**
1284
+ * Creates a new data box object.
1285
+ * @constructor
1286
+ * @returns a newly-allocated data box.
1287
+ */
1288
+ constructor()
1289
+ /**
1290
+ * Creates a new data box object.
1291
+ * @constructor
1292
+ * @returns a newly-allocated data box.
1293
+ */
1294
+ static new(): MediaBox
1295
+
1296
+ // Overloads of new
1297
+
1298
+ /**
1299
+ * Creates a new data media object.
1300
+ * @constructor
1301
+ * @returns a newly-allocated data media.
1302
+ */
1303
+ static new(): Media
1304
+ /**
1305
+ * Creates a new data object.
1306
+ * @constructor
1307
+ * @returns a new data object.
1308
+ */
1309
+ static new(): Data
1310
+ _init(config?: MediaBox.ConstructorProperties): void
1311
+ }
1312
+
1313
+ export module MediaImage {
1314
+
1315
+ // Constructor properties interface
1316
+
1317
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1318
+ }
1319
+
1320
+ }
1321
+
1322
+ export interface MediaImage {
1323
+
1324
+ // Own fields of Grl-0.1.Grl.MediaImage
1325
+
1326
+ parent: Media & Data & GObject.Object & GObject.Object
1327
+
1328
+ // Owm methods of Grl-0.1.Grl.MediaImage
1329
+
1330
+ /**
1331
+ * Sets all the keys related with the URL of a media resource and adds it to
1332
+ * `image` (useful for resources with more than one URL).
1333
+ * @param url a image's url
1334
+ * @param mime image mime-type
1335
+ * @param width image width, or -1 to ignore
1336
+ * @param height image height, or -1 to ignore
1337
+ */
1338
+ add_url_data(url: string | null, mime: string | null, width: number, height: number): void
1339
+
1340
+ // Overloads of add_url_data
1341
+
1342
+ /**
1343
+ * Adds a new media's URL with its mime-type.
1344
+ * @param url a media's URL
1345
+ * @param mime th `url` mime type
1346
+ */
1347
+ add_url_data(url: string | null, mime: string | null): void
1348
+ get_camera_model(): string | null
1349
+ get_exposure_time(): number
1350
+ /**
1351
+ * See
1352
+ * http://library.gnome.org/devel/ontology/unstable/nmm-classes.html#nmm-Flash
1353
+ * @returns whether the flash was used
1354
+ */
1355
+ get_flash_used(): string | null
1356
+ get_height(): number
1357
+ get_iso_speed(): number
1358
+ get_orientation(): number
1359
+ get_url_data(width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
1360
+
1361
+ // Overloads of get_url_data
1362
+
1363
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1364
+ /**
1365
+ * in one go.
1366
+ * @param index element to retrieve
1367
+ * @param width the width, or %NULL to ignore
1368
+ * @param height the height, or %NULL to ignore
1369
+ * @returns all the keys related with the URL number @index of an image resource
1370
+ */
1371
+ get_url_data_nth(index: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
1372
+
1373
+ // Overloads of get_url_data_nth
1374
+
1375
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1376
+ get_width(): number
1377
+ set_camera_model(camera_model: string | null): void
1378
+ set_exposure_time(exposure_time: number): void
1379
+ set_flash_used(flash_used: string | null): void
1380
+ /**
1381
+ * Set the height of the image
1382
+ * @param height the image's height
1383
+ */
1384
+ set_height(height: number): void
1385
+ set_iso_speed(iso_speed: number): void
1386
+ set_orientation(orientation: number): void
1387
+ /**
1388
+ * Set the size of the image
1389
+ * @param width the image's width
1390
+ * @param height the image's height
1391
+ */
1392
+ set_size(width: number, height: number): void
1393
+ /**
1394
+ * Sets all the keys related with the URL of an image resource in one go.
1395
+ * @param url the image's url
1396
+ * @param mime image mime-type
1397
+ * @param width image width, or -1 to ignore
1398
+ * @param height image height, or -1 to ignore
1399
+ */
1400
+ set_url_data(url: string | null, mime: string | null, width: number, height: number): void
1401
+
1402
+ // Overloads of set_url_data
1403
+
1404
+ /**
1405
+ * Set the media's URL and its mime-type.
1406
+ * @param url the media's URL
1407
+ * @param mime the `url` mime type
1408
+ */
1409
+ set_url_data(url: string | null, mime: string | null): void
1410
+ /**
1411
+ * Set the width of the image
1412
+ * @param width the image's width
1413
+ */
1414
+ set_width(width: number): void
1415
+
1416
+ // Class property signals of Grl-0.1.Grl.MediaImage
1417
+
1418
+ connect(sigName: "notify::overwrite", callback: (($obj: MediaImage, pspec: GObject.ParamSpec) => void)): number
1419
+ connect_after(sigName: "notify::overwrite", callback: (($obj: MediaImage, pspec: GObject.ParamSpec) => void)): number
1420
+ emit(sigName: "notify::overwrite", ...args: any[]): void
1421
+ connect(sigName: string, callback: (...args: any[]) => void): number
1422
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1423
+ emit(sigName: string, ...args: any[]): void
1424
+ disconnect(id: number): void
1425
+ }
1426
+
1427
+ export class MediaImage extends Media {
1428
+
1429
+ // Own properties of Grl-0.1.Grl.MediaImage
1430
+
1431
+ static name: string
1432
+ static $gtype: GObject.GType<MediaImage>
1433
+
1434
+ // Constructors of Grl-0.1.Grl.MediaImage
1435
+
1436
+ constructor(config?: MediaImage.ConstructorProperties)
1437
+ /**
1438
+ * Creates a new data image object.
1439
+ * @constructor
1440
+ * @returns a newly-allocated data image.
1441
+ */
1442
+ constructor()
1443
+ /**
1444
+ * Creates a new data image object.
1445
+ * @constructor
1446
+ * @returns a newly-allocated data image.
1447
+ */
1448
+ static new(): MediaImage
1449
+
1450
+ // Overloads of new
1451
+
1452
+ /**
1453
+ * Creates a new data media object.
1454
+ * @constructor
1455
+ * @returns a newly-allocated data media.
1456
+ */
1457
+ static new(): Media
1458
+ /**
1459
+ * Creates a new data object.
1460
+ * @constructor
1461
+ * @returns a new data object.
1462
+ */
1463
+ static new(): Data
1464
+ _init(config?: MediaImage.ConstructorProperties): void
1465
+ }
1466
+
1467
+ export module MediaPlugin {
1468
+
1469
+ // Constructor properties interface
1470
+
1471
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1472
+ }
1473
+
1474
+ }
1475
+
1476
+ export interface MediaPlugin {
1477
+
1478
+ // Own fields of Grl-0.1.Grl.MediaPlugin
1479
+
1480
+ parent: GObject.Object
1481
+
1482
+ // Owm methods of Grl-0.1.Grl.MediaPlugin
1483
+
1484
+ /**
1485
+ * Get the author of the plugin
1486
+ * @returns the author of the @plugin
1487
+ */
1488
+ get_author(): string | null
1489
+ /**
1490
+ * Get the description of the plugin
1491
+ * @returns the description of the @plugin
1492
+ */
1493
+ get_description(): string | null
1494
+ /**
1495
+ * Get the filename containing the plugin
1496
+ * @returns the filename containing @plugin
1497
+ */
1498
+ get_filename(): string | null
1499
+ /**
1500
+ * Get the id of the plugin
1501
+ * @returns the id of the @plugin
1502
+ */
1503
+ get_id(): string | null
1504
+ /**
1505
+ * Get the information of the `plugin` that is associated with the given key
1506
+ * @param key a key representing information about this plugin
1507
+ * @returns the information assigned to the given @key or NULL if there is no such information
1508
+ */
1509
+ get_info(key: string | null): string | null
1510
+ /**
1511
+ * Returns a list of keys that can be queried to retrieve information about the
1512
+ * plugin.
1513
+ *
1514
+ * a #GList of strings containing the keys. The content of the list is
1515
+ * owned by the plugin and should not be modified or freed. Use g_list_free()
1516
+ * when done using the list.
1517
+ */
1518
+ get_info_keys(): string[]
1519
+ /**
1520
+ * Get the license of the plugin
1521
+ * @returns the license of the @plugin
1522
+ */
1523
+ get_license(): string | null
1524
+ /**
1525
+ * Get the name of the plugin
1526
+ * @returns the name of the @plugin
1527
+ */
1528
+ get_name(): string | null
1529
+ /**
1530
+ * Get the #GrlPluginRank of the plugin
1531
+ * @returns the rank of the plugin
1532
+ */
1533
+ get_rank(): number
1534
+ /**
1535
+ * Get the site of the plugin
1536
+ * @returns the site of the @plugin
1537
+ */
1538
+ get_site(): string | null
1539
+ /**
1540
+ * Get the version of the plugin
1541
+ * @returns the version of the @plugin
1542
+ */
1543
+ get_version(): string | null
1544
+ set_plugin_info(info: PluginInfo): void
1545
+
1546
+ // Class property signals of Grl-0.1.Grl.MediaPlugin
1547
+
1548
+ connect(sigName: string, callback: (...args: any[]) => void): number
1549
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1550
+ emit(sigName: string, ...args: any[]): void
1551
+ disconnect(id: number): void
1552
+ }
1553
+
1554
+ export class MediaPlugin extends GObject.Object {
1555
+
1556
+ // Own properties of Grl-0.1.Grl.MediaPlugin
1557
+
1558
+ static name: string
1559
+ static $gtype: GObject.GType<MediaPlugin>
1560
+
1561
+ // Constructors of Grl-0.1.Grl.MediaPlugin
1562
+
1563
+ constructor(config?: MediaPlugin.ConstructorProperties)
1564
+ _init(config?: MediaPlugin.ConstructorProperties): void
1565
+ }
1566
+
1567
+ export module MediaSource {
1568
+
1569
+ // Signal callback interfaces
1570
+
1571
+ /**
1572
+ * Signal callback interface for `content-changed`
1573
+ */
1574
+ export interface ContentChangedSignalCallback {
1575
+ ($obj: MediaSource, changed_medias: any[], change_type: MediaSourceChangeType, location_unknown: boolean): void
1576
+ }
1577
+
1578
+
1579
+ // Constructor properties interface
1580
+
1581
+ export interface ConstructorProperties extends MetadataSource.ConstructorProperties {
1582
+
1583
+ // Own constructor properties of Grl-0.1.Grl.MediaSource
1584
+
1585
+ /**
1586
+ * Transparently split queries with count requests
1587
+ * bigger than a certain threshold into smaller queries.
1588
+ */
1589
+ auto_split_threshold?: number | null
1590
+ }
1591
+
1592
+ }
1593
+
1594
+ export interface MediaSource {
1595
+
1596
+ // Own properties of Grl-0.1.Grl.MediaSource
1597
+
1598
+ /**
1599
+ * Transparently split queries with count requests
1600
+ * bigger than a certain threshold into smaller queries.
1601
+ */
1602
+ auto_split_threshold: number
1603
+
1604
+ // Own fields of Grl-0.1.Grl.MediaSource
1605
+
1606
+ parent: MetadataSource & MediaPlugin & GObject.Object & GObject.Object
1607
+
1608
+ // Owm methods of Grl-0.1.Grl.MediaSource
1609
+
1610
+ /**
1611
+ * Browse from `skip,` a `count` number of media elements through an available list.
1612
+ *
1613
+ * This method is asynchronous.
1614
+ * @param container a container of data transfer objects
1615
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1616
+ * @param skip the number if elements to skip in the browse operation
1617
+ * @param count the number of elements to retrieve in the browse operation
1618
+ * @param flags the resolution mode
1619
+ * @param callback the user defined callback
1620
+ * @returns the operation identifier
1621
+ */
1622
+ browse(container: Media | null, keys: GObject.ParamSpec[], skip: number, count: number, flags: MetadataResolutionFlags, callback: MediaSourceResultCb): number
1623
+ /**
1624
+ * Browse from `skip,` a `count` number of media elements through an available
1625
+ * list.
1626
+ *
1627
+ * This method is synchronous.
1628
+ *
1629
+ * elements. After use g_object_unref() every element and g_list_free() the
1630
+ * list.
1631
+ * @param container a container of data transfer objects
1632
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1633
+ * @param skip the number if elements to skip in the browse operation
1634
+ * @param count the number of elements to retrieve in the browse operation
1635
+ * @param flags the resolution mode
1636
+ * @returns a #GList with #GrlMedia
1637
+ */
1638
+ browse_sync(container: Media | null, keys: GObject.ParamSpec[], skip: number, count: number, flags: MetadataResolutionFlags): Media[]
1639
+ /**
1640
+ * Cancel a running method.
1641
+ *
1642
+ * The derived class must implement the cancel vmethod in order to honour the
1643
+ * request correctly. Otherwise, the operation will not be interrupted.
1644
+ *
1645
+ * In all cases, if this function is called on an ongoing operation, the
1646
+ * corresponding callback will be called with the
1647
+ * `GRL_CORE_ERROR_OPERATION_CANCELLED` error set, and no more action will be
1648
+ * taken for that operation after the said callback with error has been called.
1649
+ * @param operation_id the identifier of the running operation, as returned by the function that started it
1650
+ */
1651
+ cancel(operation_id: number): void
1652
+ /**
1653
+ * TBD
1654
+ * @returns the assigned threshold
1655
+ */
1656
+ get_auto_split_threshold(): number
1657
+ /**
1658
+ * Creates an instance of #GrlMedia representing the media resource
1659
+ * exposed at `uri`.
1660
+ *
1661
+ * It is recommended to call grl_media_source_test_media_from_uri() before
1662
+ * invoking this to check whether the target source can theoretically do the
1663
+ * resolution.
1664
+ *
1665
+ * This method is asynchronous.
1666
+ * @param uri A URI that can be used to identify a media resource
1667
+ * @param keys A list of keys to resolve
1668
+ * @param flags the resolution mode
1669
+ * @param callback the user defined callback
1670
+ * @returns the operation identifier
1671
+ */
1672
+ get_media_from_uri(uri: string | null, keys: KeyID[], flags: MetadataResolutionFlags, callback: MediaSourceMetadataCb): number
1673
+ /**
1674
+ * Creates an instance of #GrlMedia representing the media resource
1675
+ * exposed at `uri`.
1676
+ *
1677
+ * It is recommended to call grl_media_source_test_media_from_uri() before
1678
+ * invoking this to check whether the target source can theoretically do the
1679
+ * resolution.
1680
+ *
1681
+ * This method is synchronous.
1682
+ * @param uri A URI that can be used to identify a media resource
1683
+ * @param keys A list of keys to resolve
1684
+ * @param flags the resolution mode
1685
+ * @returns a filled #GrlMedia
1686
+ */
1687
+ get_media_from_uri_sync(uri: string | null, keys: KeyID[], flags: MetadataResolutionFlags): Media
1688
+ /**
1689
+ * Obtains the previously attached data
1690
+ * @param operation_id the identifier of a running operation
1691
+ * @returns The previously attached data.
1692
+ */
1693
+ get_operation_data(operation_id: number): any
1694
+ /**
1695
+ * This method is intended to fetch the requested keys of metadata of
1696
+ * a given `media` to the media source.
1697
+ *
1698
+ * This method is asynchronous.
1699
+ * @param media a data transfer object
1700
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1701
+ * @param flags the resolution mode
1702
+ * @param callback the user defined callback
1703
+ * @returns the operation identifier
1704
+ */
1705
+ metadata(media: Media | null, keys: GObject.ParamSpec[], flags: MetadataResolutionFlags, callback: MediaSourceMetadataCb): number
1706
+ /**
1707
+ * This method is intended to fetch the requested keys of metadata of
1708
+ * a given `media` to the media source.
1709
+ *
1710
+ * This method is synchronous.
1711
+ * @param media a data transfer object
1712
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1713
+ * @param flags the resolution mode
1714
+ * @returns a filled #GrlMedia
1715
+ */
1716
+ metadata_sync(media: Media | null, keys: GObject.ParamSpec[], flags: MetadataResolutionFlags): Media
1717
+ /**
1718
+ * Emits "content-changed" signal to notify subscribers that a change ocurred
1719
+ * in `source`.
1720
+ *
1721
+ * See #grl_media_source_notify_change_list() function.
1722
+ *
1723
+ * <note>
1724
+ * <para>
1725
+ * This function is intended to be used only by plugins.
1726
+ * </para>
1727
+ * </note>
1728
+ * @param media the media which has changed, or `NULL` to use the root box.
1729
+ * @param change_type the type of change
1730
+ * @param location_unknown if change has happened in `media` or any descendant
1731
+ */
1732
+ notify_change(media: Media | null, change_type: MediaSourceChangeType, location_unknown: boolean): void
1733
+ /**
1734
+ * Emits "content-changed" signal to notify subscribers that a change ocurred
1735
+ * in `source`.
1736
+ *
1737
+ * The function will take ownership of `changed` medias and it should not be
1738
+ * manipulated in any way by the caller after invoking this function. If that is
1739
+ * needed, the caller must ref the array in advance.
1740
+ *
1741
+ * See GrlMediaSource::content-changed signal.
1742
+ *
1743
+ * <note>
1744
+ * <para>
1745
+ * This function is intended to be used only by plugins.
1746
+ * </para>
1747
+ * </note>
1748
+ * @param changed_medias : the list of medias that have changed
1749
+ * @param change_type the type of change
1750
+ * @param location_unknown if change has happpened in `media` or any descendant
1751
+ */
1752
+ notify_change_list(changed_medias: Media[], change_type: MediaSourceChangeType, location_unknown: boolean): void
1753
+ /**
1754
+ * Starts emitting ::content-changed signals when `source` discovers changes in
1755
+ * the content. This instructs `source` to setup the machinery needed to be aware
1756
+ * of changes in the content.
1757
+ * @returns @TRUE if initialization has succeed.
1758
+ */
1759
+ notify_change_start(): boolean
1760
+ /**
1761
+ * This will drop emission of ::content-changed signals from `source`. When this
1762
+ * is done `source` should stop the machinery required for it to track changes in
1763
+ * the content.
1764
+ * @returns @TRUE if stop has succeed.
1765
+ */
1766
+ notify_change_stop(): boolean
1767
+ /**
1768
+ * Execute a specialized query (specific for each provider) on a media
1769
+ * repository.
1770
+ *
1771
+ * It is different from grl_media_source_search() semantically, because
1772
+ * the query implies a carefully crafted string, rather than a simple
1773
+ * string to search.
1774
+ *
1775
+ * This method is asynchronous.
1776
+ * @param query the query to process
1777
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1778
+ * @param skip the number if elements to skip in the query operation
1779
+ * @param count the number of elements to retrieve in the query operation
1780
+ * @param flags the resolution mode
1781
+ * @param callback the user defined callback
1782
+ * @returns the operation identifier
1783
+ */
1784
+ query(query: string | null, keys: GObject.ParamSpec[], skip: number, count: number, flags: MetadataResolutionFlags, callback: MediaSourceResultCb): number
1785
+ /**
1786
+ * Execute a specialized query (specific for each provider) on a media
1787
+ * repository.
1788
+ *
1789
+ * This method is synchronous.
1790
+ *
1791
+ * elements. After use g_object_unref() every element and g_list_free() the
1792
+ * list.
1793
+ * @param query the query to process
1794
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1795
+ * @param skip the number if elements to skip in the query operation
1796
+ * @param count the number of elements to retrieve in the query operation
1797
+ * @param flags the resolution mode
1798
+ * @returns a #GList with #GrlMedia
1799
+ */
1800
+ query_sync(query: string | null, keys: GObject.ParamSpec[], skip: number, count: number, flags: MetadataResolutionFlags): Media[]
1801
+ /**
1802
+ * Remove a `media` from the `source` repository.
1803
+ *
1804
+ * This method is asynchronous.
1805
+ * @param media a data transfer object
1806
+ * @param callback the user defined callback
1807
+ */
1808
+ remove(media: Media, callback: MediaSourceRemoveCb): void
1809
+ /**
1810
+ * Remove a `media` from the `source` repository.
1811
+ *
1812
+ * This method is synchronous.
1813
+ * @param media a data transfer object
1814
+ */
1815
+ remove_sync(media: Media): void
1816
+ /**
1817
+ * Search for the `text` string in a media source for data identified with
1818
+ * that string.
1819
+ *
1820
+ * If `text` is `NULL` then no text filter will be applied, and thus, no media
1821
+ * items from `source` will be filtered. If `source` does not support NULL-text
1822
+ * search operations it should notiy the client by setting
1823
+ * `GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED` in `callback'`s error parameter.
1824
+ *
1825
+ * This method is asynchronous.
1826
+ * @param text the text to search
1827
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1828
+ * @param skip the number if elements to skip in the search operation
1829
+ * @param count the number of elements to retrieve in the search operation
1830
+ * @param flags the resolution mode
1831
+ * @param callback the user defined callback
1832
+ * @returns the operation identifier
1833
+ */
1834
+ search(text: string | null, keys: GObject.ParamSpec[], skip: number, count: number, flags: MetadataResolutionFlags, callback: MediaSourceResultCb): number
1835
+ /**
1836
+ * Search for the `text` string in a media source for data identified with
1837
+ * that string.
1838
+ *
1839
+ * If `text` is `NULL` then no text filter will be applied, and thus, no media
1840
+ * items from `source` will be filtered. If `source` does not support NULL-text
1841
+ * search operations it should notiy the client by setting
1842
+ * `GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED` in the error parameter.
1843
+ *
1844
+ * This method is synchronous.
1845
+ *
1846
+ * elements. After use g_object_unref() every element and g_list_free() the
1847
+ * list.
1848
+ * @param text the text to search
1849
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
1850
+ * @param skip the number if elements to skip in the search operation
1851
+ * @param count the number of elements to retrieve in the search operation
1852
+ * @param flags the resolution mode
1853
+ * @returns a #GList with #GrlMedia
1854
+ */
1855
+ search_sync(text: string | null, keys: GObject.ParamSpec[], skip: number, count: number, flags: MetadataResolutionFlags): Media[]
1856
+ /**
1857
+ * TBD
1858
+ * @param threshold the threshold to request
1859
+ */
1860
+ set_auto_split_threshold(threshold: number): void
1861
+ /**
1862
+ * Attach a pointer to the specific operation.
1863
+ * @param operation_id the identifier of a running operation
1864
+ * @param data the data to attach
1865
+ */
1866
+ set_operation_data(operation_id: number, data: any): void
1867
+ /**
1868
+ * Store the `media` into the `parent` container
1869
+ *
1870
+ * This method is asynchronous.
1871
+ * @param parent a parent to store the data transfer objects
1872
+ * @param media a data transfer object
1873
+ * @param callback the user defined callback
1874
+ */
1875
+ store(parent: MediaBox | null, media: Media, callback: MediaSourceStoreCb): void
1876
+ /**
1877
+ * Store the `media` into the `parent` container.
1878
+ *
1879
+ * This method is synchronous.
1880
+ * @param parent a #GrlMediaBox to store the data transfer objects
1881
+ * @param media a #GrlMedia data transfer object
1882
+ */
1883
+ store_sync(parent: MediaBox | null, media: Media): void
1884
+ /**
1885
+ * Tests whether `source` can instantiate a #GrlMedia object representing
1886
+ * the media resource exposed at `uri`.
1887
+ *
1888
+ *
1889
+ * This method is synchronous.
1890
+ * @param uri A URI that can be used to identify a media resource
1891
+ * @returns %TRUE if it can, %FALSE otherwise.
1892
+ */
1893
+ test_media_from_uri(uri: string | null): boolean
1894
+
1895
+ // Own virtual methods of Grl-0.1.Grl.MediaSource
1896
+
1897
+ vfunc_browse(bs: MediaSourceBrowseSpec): void
1898
+ /**
1899
+ * Cancel a running method.
1900
+ *
1901
+ * The derived class must implement the cancel vmethod in order to honour the
1902
+ * request correctly. Otherwise, the operation will not be interrupted.
1903
+ *
1904
+ * In all cases, if this function is called on an ongoing operation, the
1905
+ * corresponding callback will be called with the
1906
+ * `GRL_CORE_ERROR_OPERATION_CANCELLED` error set, and no more action will be
1907
+ * taken for that operation after the said callback with error has been called.
1908
+ * @virtual
1909
+ * @param operation_id the identifier of the running operation, as returned by the function that started it
1910
+ */
1911
+ vfunc_cancel(operation_id: number): void
1912
+ vfunc_media_from_uri(mfss: MediaSourceMediaFromUriSpec): void
1913
+ vfunc_metadata(ms: MediaSourceMetadataSpec): void
1914
+ /**
1915
+ * Starts emitting ::content-changed signals when `source` discovers changes in
1916
+ * the content. This instructs `source` to setup the machinery needed to be aware
1917
+ * of changes in the content.
1918
+ * @virtual
1919
+ * @returns @TRUE if initialization has succeed.
1920
+ */
1921
+ vfunc_notify_change_start(): boolean
1922
+ /**
1923
+ * This will drop emission of ::content-changed signals from `source`. When this
1924
+ * is done `source` should stop the machinery required for it to track changes in
1925
+ * the content.
1926
+ * @virtual
1927
+ * @returns @TRUE if stop has succeed.
1928
+ */
1929
+ vfunc_notify_change_stop(): boolean
1930
+ vfunc_query(qs: MediaSourceQuerySpec): void
1931
+ vfunc_remove(ss: MediaSourceRemoveSpec): void
1932
+ vfunc_search(ss: MediaSourceSearchSpec): void
1933
+ vfunc_store(ss: MediaSourceStoreSpec): void
1934
+ /**
1935
+ * Tests whether `source` can instantiate a #GrlMedia object representing
1936
+ * the media resource exposed at `uri`.
1937
+ *
1938
+ *
1939
+ * This method is synchronous.
1940
+ * @virtual
1941
+ * @param uri A URI that can be used to identify a media resource
1942
+ * @returns %TRUE if it can, %FALSE otherwise.
1943
+ */
1944
+ vfunc_test_media_from_uri(uri: string | null): boolean
1945
+
1946
+ // Own signals of Grl-0.1.Grl.MediaSource
1947
+
1948
+ connect(sigName: "content-changed", callback: MediaSource.ContentChangedSignalCallback): number
1949
+ connect_after(sigName: "content-changed", callback: MediaSource.ContentChangedSignalCallback): number
1950
+ emit(sigName: "content-changed", changed_medias: any[], change_type: MediaSourceChangeType, location_unknown: boolean, ...args: any[]): void
1951
+
1952
+ // Class property signals of Grl-0.1.Grl.MediaSource
1953
+
1954
+ connect(sigName: "notify::auto-split-threshold", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1955
+ connect_after(sigName: "notify::auto-split-threshold", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1956
+ emit(sigName: "notify::auto-split-threshold", ...args: any[]): void
1957
+ connect(sigName: "notify::source-desc", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1958
+ connect_after(sigName: "notify::source-desc", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1959
+ emit(sigName: "notify::source-desc", ...args: any[]): void
1960
+ connect(sigName: "notify::source-id", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1961
+ connect_after(sigName: "notify::source-id", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1962
+ emit(sigName: "notify::source-id", ...args: any[]): void
1963
+ connect(sigName: "notify::source-name", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1964
+ connect_after(sigName: "notify::source-name", callback: (($obj: MediaSource, pspec: GObject.ParamSpec) => void)): number
1965
+ emit(sigName: "notify::source-name", ...args: any[]): void
1966
+ connect(sigName: string, callback: (...args: any[]) => void): number
1967
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1968
+ emit(sigName: string, ...args: any[]): void
1969
+ disconnect(id: number): void
1970
+ }
1971
+
1972
+ export class MediaSource extends MetadataSource {
1973
+
1974
+ // Own properties of Grl-0.1.Grl.MediaSource
1975
+
1976
+ static name: string
1977
+ static $gtype: GObject.GType<MediaSource>
1978
+
1979
+ // Constructors of Grl-0.1.Grl.MediaSource
1980
+
1981
+ constructor(config?: MediaSource.ConstructorProperties)
1982
+ _init(config?: MediaSource.ConstructorProperties): void
1983
+ }
1984
+
1985
+ export module MediaVideo {
1986
+
1987
+ // Constructor properties interface
1988
+
1989
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1990
+ }
1991
+
1992
+ }
1993
+
1994
+ export interface MediaVideo {
1995
+
1996
+ // Own fields of Grl-0.1.Grl.MediaVideo
1997
+
1998
+ parent: Media & Data & GObject.Object & GObject.Object
1999
+
2000
+ // Owm methods of Grl-0.1.Grl.MediaVideo
2001
+
2002
+ /**
2003
+ * Sets all the keys related with the URL of a media resource and adds it to
2004
+ * `video` (useful for resources with more than one URL).
2005
+ * @param url a video's url
2006
+ * @param mime video mime-type
2007
+ * @param framerate video framerate, or -1 to ignore
2008
+ * @param width video width, or -1 to ignore
2009
+ * @param height video height, or -1 to ignore
2010
+ */
2011
+ add_url_data(url: string | null, mime: string | null, framerate: number, width: number, height: number): void
2012
+
2013
+ // Overloads of add_url_data
2014
+
2015
+ /**
2016
+ * Adds a new media's URL with its mime-type.
2017
+ * @param url a media's URL
2018
+ * @param mime th `url` mime type
2019
+ */
2020
+ add_url_data(url: string | null, mime: string | null): void
2021
+ get_episode(): number
2022
+ get_framerate(): number
2023
+ get_height(): number
2024
+ get_season(): number
2025
+ get_show(): string | null
2026
+ get_url_data(framerate: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
2027
+
2028
+ // Overloads of get_url_data
2029
+
2030
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
2031
+ /**
2032
+ * in one go.
2033
+ * @param index element to retrieve
2034
+ * @param framerate the url framerate, or %NULL to ignore
2035
+ * @param width the url width, or %NULL to ignore
2036
+ * @param height the url height, or %NULL to ignore
2037
+ * @returns all the keys related with the URL number @index of a video resource
2038
+ */
2039
+ get_url_data_nth(index: number, framerate: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
2040
+
2041
+ // Overloads of get_url_data_nth
2042
+
2043
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
2044
+ get_width(): number
2045
+ /**
2046
+ * Sets the episode number of the video
2047
+ * @param episode the video's episode
2048
+ */
2049
+ set_episode(episode: number): void
2050
+ /**
2051
+ * Set the framerate of the video
2052
+ * @param framerate the video's framerate
2053
+ */
2054
+ set_framerate(framerate: number): void
2055
+ /**
2056
+ * Set the height of the video
2057
+ * @param height the video's height
2058
+ */
2059
+ set_height(height: number): void
2060
+ /**
2061
+ * Sets the season number of the video
2062
+ * @param season the video's season
2063
+ */
2064
+ set_season(season: number): void
2065
+ /**
2066
+ * Sets the show title of the video
2067
+ * @param show the video's show name
2068
+ */
2069
+ set_show(show: string | null): void
2070
+ /**
2071
+ * Set the width and the height of the video
2072
+ * @param width the video's width
2073
+ * @param height the video's height
2074
+ */
2075
+ set_size(width: number, height: number): void
2076
+ /**
2077
+ * Sets all the keys related with the URL of a video resource in one go.
2078
+ * @param url the video's url
2079
+ * @param mime video mime-type
2080
+ * @param framerate video framerate, or -1 to ignore
2081
+ * @param width video width, or -1 to ignore
2082
+ * @param height video height, or -1 to ignore
2083
+ */
2084
+ set_url_data(url: string | null, mime: string | null, framerate: number, width: number, height: number): void
2085
+
2086
+ // Overloads of set_url_data
2087
+
2088
+ /**
2089
+ * Set the media's URL and its mime-type.
2090
+ * @param url the media's URL
2091
+ * @param mime the `url` mime type
2092
+ */
2093
+ set_url_data(url: string | null, mime: string | null): void
2094
+ /**
2095
+ * Set the width of the video
2096
+ * @param width the video's width
2097
+ */
2098
+ set_width(width: number): void
2099
+
2100
+ // Class property signals of Grl-0.1.Grl.MediaVideo
2101
+
2102
+ connect(sigName: "notify::overwrite", callback: (($obj: MediaVideo, pspec: GObject.ParamSpec) => void)): number
2103
+ connect_after(sigName: "notify::overwrite", callback: (($obj: MediaVideo, pspec: GObject.ParamSpec) => void)): number
2104
+ emit(sigName: "notify::overwrite", ...args: any[]): void
2105
+ connect(sigName: string, callback: (...args: any[]) => void): number
2106
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2107
+ emit(sigName: string, ...args: any[]): void
2108
+ disconnect(id: number): void
2109
+ }
2110
+
2111
+ export class MediaVideo extends Media {
2112
+
2113
+ // Own properties of Grl-0.1.Grl.MediaVideo
2114
+
2115
+ static name: string
2116
+ static $gtype: GObject.GType<MediaVideo>
2117
+
2118
+ // Constructors of Grl-0.1.Grl.MediaVideo
2119
+
2120
+ constructor(config?: MediaVideo.ConstructorProperties)
2121
+ /**
2122
+ * Creates a new data video object.
2123
+ * @constructor
2124
+ * @returns a newly-allocated data video.
2125
+ */
2126
+ constructor()
2127
+ /**
2128
+ * Creates a new data video object.
2129
+ * @constructor
2130
+ * @returns a newly-allocated data video.
2131
+ */
2132
+ static new(): MediaVideo
2133
+
2134
+ // Overloads of new
2135
+
2136
+ /**
2137
+ * Creates a new data media object.
2138
+ * @constructor
2139
+ * @returns a newly-allocated data media.
2140
+ */
2141
+ static new(): Media
2142
+ /**
2143
+ * Creates a new data object.
2144
+ * @constructor
2145
+ * @returns a new data object.
2146
+ */
2147
+ static new(): Data
2148
+ _init(config?: MediaVideo.ConstructorProperties): void
2149
+ }
2150
+
2151
+ export module MetadataSource {
2152
+
2153
+ // Constructor properties interface
2154
+
2155
+ export interface ConstructorProperties extends MediaPlugin.ConstructorProperties {
2156
+
2157
+ // Own constructor properties of Grl-0.1.Grl.MetadataSource
2158
+
2159
+ /**
2160
+ * A description of the source
2161
+ */
2162
+ source_desc?: string | null
2163
+ /**
2164
+ * The identifier of the source.
2165
+ */
2166
+ source_id?: string | null
2167
+ /**
2168
+ * The name of the source.
2169
+ */
2170
+ source_name?: string | null
2171
+ }
2172
+
2173
+ }
2174
+
2175
+ export interface MetadataSource {
2176
+
2177
+ // Own properties of Grl-0.1.Grl.MetadataSource
2178
+
2179
+ /**
2180
+ * A description of the source
2181
+ */
2182
+ source_desc: string
2183
+ /**
2184
+ * The identifier of the source.
2185
+ */
2186
+ source_id: string
2187
+ /**
2188
+ * The name of the source.
2189
+ */
2190
+ source_name: string
2191
+
2192
+ // Own fields of Grl-0.1.Grl.MetadataSource
2193
+
2194
+ parent: MediaPlugin & GObject.Object
2195
+
2196
+ // Owm methods of Grl-0.1.Grl.MetadataSource
2197
+
2198
+ /**
2199
+ * Cancel a running method.
2200
+ *
2201
+ * The derived class must implement the cancel vmethod in order to honour the
2202
+ * request correctly. Otherwise, the operation will not be interrupted.
2203
+ *
2204
+ * In all cases, if this function is called on an ongoing operation, the
2205
+ * corresponding callback will be called with the
2206
+ * `GRL_CORE_ERROR_OPERATION_CANCELLED` error set, and no more action will be
2207
+ * taken for that operation after the said callback with error has been called.
2208
+ * @param operation_id the identifier of the running operation, as returned by the function that started it
2209
+ */
2210
+ cancel(operation_id: number): void
2211
+ /**
2212
+ * This function does the opposite of other filter functions: removes the slow
2213
+ * keys from `keys`. If `return_filtered` is %TRUE the removed slow keys are
2214
+ * returned in a new list.
2215
+ *
2216
+ * `return_filtered` is %TRUE will return the list of slow keys; otherwise
2217
+ * %NULL
2218
+ * @param keys the list of keys to filter out
2219
+ * @param return_filtered if %TRUE the return value shall be a new list with the slow keys
2220
+ * @returns if
2221
+ */
2222
+ filter_slow(keys: GObject.ParamSpec[] | null, return_filtered: boolean): [ /* returnType */ GObject.ParamSpec[], /* keys */ GObject.ParamSpec[] | null ]
2223
+ /**
2224
+ * Compares the received `keys` list with the supported key list by the
2225
+ * metadata `source,` and deletes those keys which are not supported.
2226
+ *
2227
+ * if `return_filtered` is %TRUE will return the list of removed keys;
2228
+ * otherwise %NULL
2229
+ * @param keys the list of keys to filter out
2230
+ * @param return_filtered if %TRUE the return value shall be a new list with the unsupported keys
2231
+ */
2232
+ filter_supported(keys: GObject.ParamSpec[] | null, return_filtered: boolean): [ /* returnType */ GObject.ParamSpec[], /* keys */ GObject.ParamSpec[] | null ]
2233
+ /**
2234
+ * Similar to grl_metadata_source_filter_supported() but applied to
2235
+ * the writable keys in grl_metadata_source_writable_keys().
2236
+ *
2237
+ * Filter the `keys` list keeping only those keys that are writtable in
2238
+ * `source`. If `return_filtered` is %TRUE then the removed keys are returned in a
2239
+ * new list.
2240
+ *
2241
+ * if `return_filtered` is %TRUE will return the list of non-writtable keys;
2242
+ * otherwise %NULL
2243
+ * @param keys the list of keys to filter out
2244
+ * @param return_filtered if %TRUE the return value shall be a new list with the non-writable keys
2245
+ */
2246
+ filter_writable(keys: GObject.ParamSpec[] | null, return_filtered: boolean): [ /* returnType */ GObject.ParamSpec[], /* keys */ GObject.ParamSpec[] | null ]
2247
+ gen_operation_id(): number
2248
+ get_description(): string | null
2249
+ get_id(): string | null
2250
+ get_name(): string | null
2251
+ /**
2252
+ * Obtains the previously attached data
2253
+ * @param operation_id the identifier of a running operation
2254
+ * @returns The previously attached data.
2255
+ */
2256
+ get_operation_data(operation_id: number): any
2257
+ /**
2258
+ * Get the list of #GrlKeyID which are needed a priori, in order to fetch
2259
+ * and store the requested `key_id`
2260
+ *
2261
+ * a #GList with the keys, or `NULL` if it can not resolve `key_id`
2262
+ * @param key_id the requested metadata key
2263
+ */
2264
+ key_depends(key_id: GObject.ParamSpec): GObject.ParamSpec[]
2265
+ /**
2266
+ * Checks whether `key_id` may be resolved with `source` for `media,` so that the
2267
+ * caller can avoid calling grl_metadata_source_resolve() if it can be known in
2268
+ * advance it will fail.
2269
+ *
2270
+ * If the resolution is known to be impossible because more keys are needed in
2271
+ * `media,` and `missing_keys` is not `NULL,` it is populated with the list of
2272
+ * GrlKeyID that would be needed.
2273
+ *
2274
+ * This function is synchronous and should not block.
2275
+ *
2276
+ * `media,` `FALSE` otherwise.
2277
+ * @param media a media on which we want more metadata
2278
+ * @param key_id the key corresponding to a metadata we might want
2279
+ * @returns @TRUE if there's a possibility that @source resolves @key_id for
2280
+ */
2281
+ may_resolve(media: Media, key_id: KeyID): [ /* returnType */ boolean, /* missing_keys */ KeyID[] ]
2282
+ operation_is_cancelled(operation_id: number): boolean
2283
+ operation_is_completed(operation_id: number): boolean
2284
+ operation_is_finished(operation_id: number): boolean
2285
+ operation_is_ongoing(operation_id: number): boolean
2286
+ /**
2287
+ * This is the main method of the #GrlMetadataSource class. It will fetch the
2288
+ * metadata of the requested keys.
2289
+ *
2290
+ * This function is asynchronous.
2291
+ * @param keys the #GList of #GrlKeyID to retrieve
2292
+ * @param media Transfer object where all the metadata is stored.
2293
+ * @param flags bitwise mask of #GrlMetadataResolutionFlags with the resolution strategy
2294
+ * @param callback the callback to execute when the `media` metadata is filled up
2295
+ * @returns the operation identifier
2296
+ */
2297
+ resolve(keys: GObject.ParamSpec[] | null, media: Media, flags: MetadataResolutionFlags, callback: MetadataSourceResolveCb): number
2298
+ /**
2299
+ * This is the main method of the #GrlMetadataSource class. It will fetch the
2300
+ * metadata of the requested keys.
2301
+ *
2302
+ * This function is synchronous.
2303
+ * @param keys the #GList of #GrlKeyID to retrieve
2304
+ * @param media Transfer object where all the metadata is stored
2305
+ * @param flags bitwise mask of #GrlMetadataResolutionFlags with the resolution strategy
2306
+ * @returns the updated #GrlMedia
2307
+ */
2308
+ resolve_sync(keys: GObject.ParamSpec[] | null, media: Media, flags: MetadataResolutionFlags): Media
2309
+ /**
2310
+ * This is the main method of the #GrlMetadataSource class. It will
2311
+ * get the values for `keys` from `media` and store it permanently. After
2312
+ * calling this method, future queries that return this media object
2313
+ * shall return this new values for the selected keys.
2314
+ *
2315
+ * This function is asynchronous and uses the Glib's main loop.
2316
+ * @param media the #GrlMedia object that we want to operate on.
2317
+ * @param keys a list of #GrlKeyID whose values we want to change.
2318
+ * @param flags Flags to configure specific behaviors of the operation.
2319
+ * @param callback the callback to execute when the operation is finished.
2320
+ */
2321
+ set_metadata(media: Media, keys: GObject.ParamSpec[] | null, flags: MetadataWritingFlags, callback: MetadataSourceSetMetadataCb): void
2322
+ /**
2323
+ * This is the main method of the #GrlMetadataSource class. It will
2324
+ * get the value for `key` from `media` and store it permanently. After
2325
+ * calling this method, future queries that return this media object
2326
+ * shall return this new value for the selected key.
2327
+ *
2328
+ * This function is synchronous.
2329
+ *
2330
+ * a #GList of keys that could not be updated, or `NULL`
2331
+ * @param media the #GrlMedia object that we want to operate on
2332
+ * @param keys a list of #GrlKeyID whose values we want to change
2333
+ * @param flags Flags to configure specific behaviors of the operation.
2334
+ */
2335
+ set_metadata_sync(media: Media, keys: GObject.ParamSpec[] | null, flags: MetadataWritingFlags): GObject.ParamSpec[]
2336
+ set_operation_cancelled(operation_id: number): void
2337
+ set_operation_completed(operation_id: number): void
2338
+ /**
2339
+ * Attach a pointer to the specific operation.
2340
+ * @param operation_id the identifier of a running operation
2341
+ * @param data the data to attach
2342
+ */
2343
+ set_operation_data(operation_id: number, data: any): void
2344
+ set_operation_finished(operation_id: number): void
2345
+ set_operation_ongoing(operation_id: number): void
2346
+ /**
2347
+ * Similar to grl_metadata_source_supported_keys(), but this keys
2348
+ * are marked as slow because of the amount of traffic/processing needed
2349
+ * to fetch them.
2350
+ * @returns a #GList with the keys
2351
+ */
2352
+ slow_keys(): GObject.ParamSpec[]
2353
+ /**
2354
+ * Get a list of #GrlKeyID, which describe a metadata types that this
2355
+ * source can fetch and store.
2356
+ * @returns a #GList with the keys
2357
+ */
2358
+ supported_keys(): GObject.ParamSpec[]
2359
+ /**
2360
+ * By default the derived objects of #GrlMetadataSource can only resolve.
2361
+ *
2362
+ * the source
2363
+ * @returns a bitwise mangle with the supported operations by
2364
+ */
2365
+ supported_operations(): number
2366
+ /**
2367
+ * Similar to grl_metadata_source_supported_keys(), but these keys
2368
+ * are marked as writable, meaning the source allows the client
2369
+ * to provide new values for these keys that will be stored permanently.
2370
+ *
2371
+ * a #GList with the keys
2372
+ */
2373
+ writable_keys(): GObject.ParamSpec[]
2374
+
2375
+ // Own virtual methods of Grl-0.1.Grl.MetadataSource
2376
+
2377
+ /**
2378
+ * Cancel a running method.
2379
+ *
2380
+ * The derived class must implement the cancel vmethod in order to honour the
2381
+ * request correctly. Otherwise, the operation will not be interrupted.
2382
+ *
2383
+ * In all cases, if this function is called on an ongoing operation, the
2384
+ * corresponding callback will be called with the
2385
+ * `GRL_CORE_ERROR_OPERATION_CANCELLED` error set, and no more action will be
2386
+ * taken for that operation after the said callback with error has been called.
2387
+ * @virtual
2388
+ * @param operation_id the identifier of the running operation, as returned by the function that started it
2389
+ */
2390
+ vfunc_cancel(operation_id: number): void
2391
+ /**
2392
+ * Get the list of #GrlKeyID which are needed a priori, in order to fetch
2393
+ * and store the requested `key_id`
2394
+ *
2395
+ * a #GList with the keys, or `NULL` if it can not resolve `key_id`
2396
+ * @virtual
2397
+ * @param key_id the requested metadata key
2398
+ */
2399
+ vfunc_key_depends(key_id: GObject.ParamSpec): GObject.ParamSpec[]
2400
+ /**
2401
+ * Checks whether `key_id` may be resolved with `source` for `media,` so that the
2402
+ * caller can avoid calling grl_metadata_source_resolve() if it can be known in
2403
+ * advance it will fail.
2404
+ *
2405
+ * If the resolution is known to be impossible because more keys are needed in
2406
+ * `media,` and `missing_keys` is not `NULL,` it is populated with the list of
2407
+ * GrlKeyID that would be needed.
2408
+ *
2409
+ * This function is synchronous and should not block.
2410
+ *
2411
+ * `media,` `FALSE` otherwise.
2412
+ * @virtual
2413
+ * @param media a media on which we want more metadata
2414
+ * @param key_id the key corresponding to a metadata we might want
2415
+ * @returns @TRUE if there's a possibility that @source resolves @key_id for
2416
+ */
2417
+ vfunc_may_resolve(media: Media, key_id: KeyID): [ /* returnType */ boolean, /* missing_keys */ KeyID[] ]
2418
+ vfunc_resolve(rs: MetadataSourceResolveSpec): void
2419
+ vfunc_set_metadata(sms: MetadataSourceSetMetadataSpec): void
2420
+ /**
2421
+ * Similar to grl_metadata_source_supported_keys(), but this keys
2422
+ * are marked as slow because of the amount of traffic/processing needed
2423
+ * to fetch them.
2424
+ * @virtual
2425
+ * @returns a #GList with the keys
2426
+ */
2427
+ vfunc_slow_keys(): GObject.ParamSpec[]
2428
+ /**
2429
+ * Get a list of #GrlKeyID, which describe a metadata types that this
2430
+ * source can fetch and store.
2431
+ * @virtual
2432
+ * @returns a #GList with the keys
2433
+ */
2434
+ vfunc_supported_keys(): GObject.ParamSpec[]
2435
+ vfunc_supported_operations(): SupportedOps
2436
+ /**
2437
+ * Similar to grl_metadata_source_supported_keys(), but these keys
2438
+ * are marked as writable, meaning the source allows the client
2439
+ * to provide new values for these keys that will be stored permanently.
2440
+ *
2441
+ * a #GList with the keys
2442
+ * @virtual
2443
+ */
2444
+ vfunc_writable_keys(): GObject.ParamSpec[]
2445
+
2446
+ // Class property signals of Grl-0.1.Grl.MetadataSource
2447
+
2448
+ connect(sigName: "notify::source-desc", callback: (($obj: MetadataSource, pspec: GObject.ParamSpec) => void)): number
2449
+ connect_after(sigName: "notify::source-desc", callback: (($obj: MetadataSource, pspec: GObject.ParamSpec) => void)): number
2450
+ emit(sigName: "notify::source-desc", ...args: any[]): void
2451
+ connect(sigName: "notify::source-id", callback: (($obj: MetadataSource, pspec: GObject.ParamSpec) => void)): number
2452
+ connect_after(sigName: "notify::source-id", callback: (($obj: MetadataSource, pspec: GObject.ParamSpec) => void)): number
2453
+ emit(sigName: "notify::source-id", ...args: any[]): void
2454
+ connect(sigName: "notify::source-name", callback: (($obj: MetadataSource, pspec: GObject.ParamSpec) => void)): number
2455
+ connect_after(sigName: "notify::source-name", callback: (($obj: MetadataSource, pspec: GObject.ParamSpec) => void)): number
2456
+ emit(sigName: "notify::source-name", ...args: any[]): void
2457
+ connect(sigName: string, callback: (...args: any[]) => void): number
2458
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2459
+ emit(sigName: string, ...args: any[]): void
2460
+ disconnect(id: number): void
2461
+ }
2462
+
2463
+ export class MetadataSource extends MediaPlugin {
2464
+
2465
+ // Own properties of Grl-0.1.Grl.MetadataSource
2466
+
2467
+ static name: string
2468
+ static $gtype: GObject.GType<MetadataSource>
2469
+
2470
+ // Constructors of Grl-0.1.Grl.MetadataSource
2471
+
2472
+ constructor(config?: MetadataSource.ConstructorProperties)
2473
+ _init(config?: MetadataSource.ConstructorProperties): void
2474
+ }
2475
+
2476
+ export module PluginRegistry {
2477
+
2478
+ // Signal callback interfaces
2479
+
2480
+ /**
2481
+ * Signal callback interface for `source-added`
2482
+ */
2483
+ export interface SourceAddedSignalCallback {
2484
+ ($obj: PluginRegistry, plugin: MediaPlugin): void
2485
+ }
2486
+
2487
+ /**
2488
+ * Signal callback interface for `source-removed`
2489
+ */
2490
+ export interface SourceRemovedSignalCallback {
2491
+ ($obj: PluginRegistry, plugin: MediaPlugin): void
2492
+ }
2493
+
2494
+
2495
+ // Constructor properties interface
2496
+
2497
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2498
+ }
2499
+
2500
+ }
2501
+
2502
+ export interface PluginRegistry {
2503
+
2504
+ // Own fields of Grl-0.1.Grl.PluginRegistry
2505
+
2506
+ parent: GObject.Object
2507
+
2508
+ // Owm methods of Grl-0.1.Grl.PluginRegistry
2509
+
2510
+ /**
2511
+ * Add a configuration for a plugin/source.
2512
+ * @param config a configuration set
2513
+ */
2514
+ add_config(config: Config): boolean
2515
+ /**
2516
+ * Load plugin configurations from a .ini-like config file.
2517
+ * @param config_file a key-value file containing the configuration
2518
+ * @returns %TRUE on success
2519
+ */
2520
+ add_config_from_file(config_file: string | null): boolean
2521
+ /**
2522
+ * Set this path as part of default paths to load plugins.
2523
+ * @param path a path with plugins
2524
+ */
2525
+ add_directory(path: string | null): void
2526
+ /**
2527
+ * Returns a list with all registered keys in system.
2528
+ *
2529
+ * with all the available #GrlKeyID<!-- -->s. The content of the list should
2530
+ * not be modified or freed. Use g_list_free() when done using the list.
2531
+ * @returns a #GList
2532
+ */
2533
+ get_metadata_keys(): GObject.ParamSpec[]
2534
+ /**
2535
+ * This function will return all the available sources in the `registry`.
2536
+ *
2537
+ * If `ranked` is %TRUE, the source list will be ordered by rank.
2538
+ *
2539
+ * available #GrlMediaPlugins<!-- -->s. The content of the list should not be
2540
+ * modified or freed. Use g_list_free() when done using the list.
2541
+ * @param ranked whether the returned list shall be returned ordered by rank
2542
+ * @returns a #GList of
2543
+ */
2544
+ get_sources(ranked: boolean): MediaPlugin[]
2545
+ /**
2546
+ * Give an array of all the available sources in the `registry` capable of
2547
+ * perform the operations requested in `ops`.
2548
+ *
2549
+ * If `ranked` is %TRUE, the source list will be ordered by rank.
2550
+ *
2551
+ * available #GrlMediaPlugins<!-- -->s. The content of the list should not be
2552
+ * modified or freed. Use g_list_free() when done using the list.
2553
+ * @param ops a bitwise mangle of the requested operations.
2554
+ * @param ranked whether the returned list shall be returned ordered by rank
2555
+ * @returns a #GList of
2556
+ */
2557
+ get_sources_by_operations(ops: SupportedOps, ranked: boolean): MediaPlugin[]
2558
+ /**
2559
+ * Loads a module from shared object file stored in `path`
2560
+ * @param library_filename the path to the so file
2561
+ * @returns %TRUE if the module is loaded correctly
2562
+ */
2563
+ load(library_filename: string | null): boolean
2564
+ /**
2565
+ * Load all the modules available in the default directory path.
2566
+ *
2567
+ * The default directory path can be changed through the environment
2568
+ * variable %GRL_PLUGIN_PATH and it can contain several paths separated
2569
+ * by ":"
2570
+ *
2571
+ * %TRUE% otherwise.
2572
+ * @returns %FALSE% is all the configured plugin paths are invalid,
2573
+ */
2574
+ load_all(): boolean
2575
+ /**
2576
+ * Loads plugin identified by `plugin_id`.
2577
+ *
2578
+ * This requires the XML plugin information file to define a "module" key with
2579
+ * the name of the module that provides the plugin or the absolute path of the
2580
+ * actual module file.
2581
+ * @param plugin_id plugin identifier
2582
+ * @returns %TRUE if the plugin is loaded correctly
2583
+ */
2584
+ load_by_id(plugin_id: string | null): boolean
2585
+ /**
2586
+ * Loads a set of modules from directory in `path` which contains
2587
+ * a group shared object files.
2588
+ * @param path the path to the directory
2589
+ * @returns %TRUE if the directory is valid.
2590
+ */
2591
+ load_directory(path: string | null): boolean
2592
+ /**
2593
+ * Look up for the metadata key with name `key_name`.
2594
+ * @param key_name the key name
2595
+ * @returns The metadata key, or @NULL if not found
2596
+ */
2597
+ lookup_metadata_key(key_name: string | null): GObject.ParamSpec
2598
+ /**
2599
+ * Look up the list of keys that have a relation with `key`.
2600
+ *
2601
+ * `key` is included in that list.
2602
+ *
2603
+ * related keys, or `NULL` if key is invalid.
2604
+ * @param key a metadata key
2605
+ * @returns a #GList of
2606
+ */
2607
+ lookup_metadata_key_relation(key: KeyID): GObject.ParamSpec[]
2608
+ /**
2609
+ * This function will search and retrieve a source given its identifier.
2610
+ * @param source_id the id of a source
2611
+ * @returns The source found.
2612
+ */
2613
+ lookup_source(source_id: string | null): MediaPlugin
2614
+ /**
2615
+ * Registers a metadata key
2616
+ *
2617
+ * or `NULL` on error.
2618
+ * @param key The key to register
2619
+ * @returns The #GrlKeyID registered
2620
+ */
2621
+ register_metadata_key(key: GObject.ParamSpec): GObject.ParamSpec
2622
+ /**
2623
+ * Creates a relation between `key1` and `key2`, meaning that the values of both
2624
+ * keys are somehow related.
2625
+ *
2626
+ * One example of a relation would be the one between the URI of a media
2627
+ * resource and its mime-type: they are both tied together and one does not make
2628
+ * sense without the other.
2629
+ *
2630
+ * Relations between keys allow the framework to provide all the data that is
2631
+ * somehow related when any of the related keys are requested.
2632
+ * @param key1 key involved in relationship
2633
+ * @param key2 key involved in relationship
2634
+ */
2635
+ register_metadata_key_relation(key1: KeyID, key2: KeyID): void
2636
+ /**
2637
+ * Register a `source` in the `registry` with the given `plugin` information
2638
+ * @param plugin the descriptor of the plugin which owns the source
2639
+ * @param source the source to register
2640
+ * @returns %TRUE if success, %FALSE% otherwise.
2641
+ */
2642
+ register_source(plugin: PluginInfo, source: MediaPlugin): boolean
2643
+ /**
2644
+ * Restrict the plugins that application sees to this list.
2645
+ *
2646
+ * Other plugins will not be available for the application, unless it uses
2647
+ * directly #grl_plugin_registry_load() function.
2648
+ * @param plugins a `NULL-terminated` array of plugins identifiers
2649
+ */
2650
+ restrict_plugins(plugins: string | null): void
2651
+ /**
2652
+ * Unload from memory a module identified by `plugin_id`. This means call the
2653
+ * module's deinit function.
2654
+ * @param plugin_id the identifier of the plugin
2655
+ * @returns %TRUE% on success.
2656
+ */
2657
+ unload(plugin_id: string | null): boolean
2658
+ /**
2659
+ * Removes the `source` from the `registry` hash table
2660
+ * @param source the source to unregister
2661
+ * @returns %TRUE if success, %FALSE% otherwise.
2662
+ */
2663
+ unregister_source(source: MediaPlugin): boolean
2664
+
2665
+ // Own signals of Grl-0.1.Grl.PluginRegistry
2666
+
2667
+ connect(sigName: "source-added", callback: PluginRegistry.SourceAddedSignalCallback): number
2668
+ connect_after(sigName: "source-added", callback: PluginRegistry.SourceAddedSignalCallback): number
2669
+ emit(sigName: "source-added", plugin: MediaPlugin, ...args: any[]): void
2670
+ connect(sigName: "source-removed", callback: PluginRegistry.SourceRemovedSignalCallback): number
2671
+ connect_after(sigName: "source-removed", callback: PluginRegistry.SourceRemovedSignalCallback): number
2672
+ emit(sigName: "source-removed", plugin: MediaPlugin, ...args: any[]): void
2673
+
2674
+ // Class property signals of Grl-0.1.Grl.PluginRegistry
2675
+
2676
+ connect(sigName: string, callback: (...args: any[]) => void): number
2677
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2678
+ emit(sigName: string, ...args: any[]): void
2679
+ disconnect(id: number): void
2680
+ }
2681
+
2682
+ export class PluginRegistry extends GObject.Object {
2683
+
2684
+ // Own properties of Grl-0.1.Grl.PluginRegistry
2685
+
2686
+ static name: string
2687
+ static $gtype: GObject.GType<PluginRegistry>
2688
+
2689
+ // Constructors of Grl-0.1.Grl.PluginRegistry
2690
+
2691
+ constructor(config?: PluginRegistry.ConstructorProperties)
2692
+ _init(config?: PluginRegistry.ConstructorProperties): void
2693
+ /**
2694
+ * As the registry is designed to work as a singleton, this
2695
+ * method is in charge of creating the only instance or
2696
+ * returned it if it is already in memory.
2697
+ *
2698
+ *
2699
+ * It is NOT MT-safe
2700
+ * @returns a new or an already created instance of the registry.
2701
+ */
2702
+ static get_default(): PluginRegistry
2703
+ }
2704
+
2705
+ export module RelatedKeys {
2706
+
2707
+ // Constructor properties interface
2708
+
2709
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2710
+ }
2711
+
2712
+ }
2713
+
2714
+ export interface RelatedKeys {
2715
+
2716
+ // Own fields of Grl-0.1.Grl.RelatedKeys
2717
+
2718
+ parent: GObject.Object
2719
+
2720
+ // Owm methods of Grl-0.1.Grl.RelatedKeys
2721
+
2722
+ /**
2723
+ * Adds a new `key` to `relkeys,` with no value. If `key` already exists, it does
2724
+ * nothing.
2725
+ * @param key key to add
2726
+ */
2727
+ add(key: GObject.ParamSpec): void
2728
+ /**
2729
+ * Makes a deep copy of `relkeys` and its contents.
2730
+ *
2731
+ * Free it with #g_object_unref.
2732
+ * @returns a new #GrlRelatedKeys.
2733
+ */
2734
+ dup(): RelatedKeys
2735
+ /**
2736
+ * Get the value associated with `key` from `relkeys`. If it does not contain any
2737
+ * value, %NULL will be returned.
2738
+ *
2739
+ * freed by user.
2740
+ * @param key key to look up.
2741
+ * @returns a #GValue. This value should not be modified nor
2742
+ */
2743
+ get(key: GObject.ParamSpec): any
2744
+ /**
2745
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2746
+ * or value is not a binary, or `key` is not in `relkeys,` then 0 is returned.
2747
+ *
2748
+ * successful `size` will be set to the buffer size.
2749
+ * @param key key to use
2750
+ * @returns buffer location associated with @key, or %NULL in other case. If
2751
+ */
2752
+ get_binary(key: GObject.ParamSpec): [ /* returnType */ number, /* size */ number ]
2753
+ /**
2754
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2755
+ * or value is not a gfloat, or `key` is not in `relkeys,` then 0 is returned.
2756
+ * @param key key to use
2757
+ * @returns float value associated with @key, or 0 in other case.
2758
+ */
2759
+ get_float(key: GObject.ParamSpec): number
2760
+ /**
2761
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2762
+ * or value is not a gint, or `key` is not in `relkeys,` then 0 is returned.
2763
+ * @param key key to use
2764
+ * @returns int value associated with @key, or 0 in other case.
2765
+ */
2766
+ get_int(key: GObject.ParamSpec): number
2767
+ /**
2768
+ * Returns a list with keys contained in `relkeys`.
2769
+ *
2770
+ * the keys. The content of the list should not be modified or freed. Use
2771
+ * g_list_free() when done using the list.
2772
+ * @returns a list with
2773
+ */
2774
+ get_keys(): GObject.ParamSpec[]
2775
+ /**
2776
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2777
+ * or value is not string, or `key` is not in `relkeys,` then %NULL is returned.
2778
+ *
2779
+ * not change nor free the value.
2780
+ * @param key key to use
2781
+ * @returns string associated with @key, or %NULL in other case. Caller should
2782
+ */
2783
+ get_string(key: GObject.ParamSpec): string | null
2784
+ /**
2785
+ * Checks if `key` is in `relkeys`.
2786
+ * @param key key to search
2787
+ * @returns %TRUE if @key is in @relkeys, %FALSE in other case.
2788
+ */
2789
+ has_key(key: GObject.ParamSpec): boolean
2790
+ /**
2791
+ * Checks if `key` has a value in `relkeys`.
2792
+ * @param key key to search
2793
+ * @returns %TRUE if @key has a value.
2794
+ */
2795
+ key_is_known(key: GObject.ParamSpec): boolean
2796
+ /**
2797
+ * Sets the value associated with `key` into `relkeys`. Old value is freed and
2798
+ * the new one is set.
2799
+ *
2800
+ * Also, checks that `value` is compliant with `key` specification, modifying it
2801
+ * accordingly. For instance, if `key` requires a number between 0 and 10, but
2802
+ * value is outside this range, it will be adapted accordingly.
2803
+ * @param key key to change or add
2804
+ * @param value the new value
2805
+ */
2806
+ set(key: GObject.ParamSpec, value: any): void
2807
+ /**
2808
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2809
+ * registered as a binary-type key. Old value is replaced by the new one.
2810
+ * @param key key to change or add
2811
+ * @param buf buffer holding the relkeys
2812
+ * @param size size of the buffer
2813
+ */
2814
+ set_binary(key: GObject.ParamSpec, buf: number, size: number): void
2815
+ /**
2816
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2817
+ * registered as a float-type key. Old value is replaced by the new one.
2818
+ * @param key key to change or add
2819
+ * @param floatvalue the new value
2820
+ */
2821
+ set_float(key: GObject.ParamSpec, floatvalue: number): void
2822
+ /**
2823
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2824
+ * registered as an int-type key. Old value is replaced by the new one.
2825
+ * @param key key to change or add
2826
+ * @param intvalue the new value
2827
+ */
2828
+ set_int(key: GObject.ParamSpec, intvalue: number): void
2829
+ /**
2830
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2831
+ * registered as a strying-type key. Old value is freed and the new one is set.
2832
+ * @param key key to change or add
2833
+ * @param strvalue the new value
2834
+ */
2835
+ set_string(key: GObject.ParamSpec, strvalue: string | null): void
2836
+
2837
+ // Class property signals of Grl-0.1.Grl.RelatedKeys
2838
+
2839
+ connect(sigName: string, callback: (...args: any[]) => void): number
2840
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2841
+ emit(sigName: string, ...args: any[]): void
2842
+ disconnect(id: number): void
2843
+ }
2844
+
2845
+ export class RelatedKeys extends GObject.Object {
2846
+
2847
+ // Own properties of Grl-0.1.Grl.RelatedKeys
2848
+
2849
+ static name: string
2850
+ static $gtype: GObject.GType<RelatedKeys>
2851
+
2852
+ // Constructors of Grl-0.1.Grl.RelatedKeys
2853
+
2854
+ constructor(config?: RelatedKeys.ConstructorProperties)
2855
+ /**
2856
+ * Creates a new #GrlRelatedKeys instance that can be used to store related
2857
+ * keys and their values.
2858
+ * @constructor
2859
+ * @returns a new object.
2860
+ */
2861
+ constructor()
2862
+ /**
2863
+ * Creates a new #GrlRelatedKeys instance that can be used to store related
2864
+ * keys and their values.
2865
+ * @constructor
2866
+ * @returns a new object.
2867
+ */
2868
+ static new(): RelatedKeys
2869
+ _init(config?: RelatedKeys.ConstructorProperties): void
2870
+ }
2871
+
2872
+ export interface ConfigClass {
2873
+
2874
+ // Own fields of Grl-0.1.Grl.ConfigClass
2875
+
2876
+ parent_class: GObject.ObjectClass
2877
+ }
2878
+
2879
+ /**
2880
+ * Grilo Config Class
2881
+ * @record
2882
+ */
2883
+ export abstract class ConfigClass {
2884
+
2885
+ // Own properties of Grl-0.1.Grl.ConfigClass
2886
+
2887
+ static name: string
2888
+ }
2889
+
2890
+ export interface ConfigPrivate {
2891
+ }
2892
+
2893
+ export class ConfigPrivate {
2894
+
2895
+ // Own properties of Grl-0.1.Grl.ConfigPrivate
2896
+
2897
+ static name: string
2898
+ }
2899
+
2900
+ export interface DataClass {
2901
+
2902
+ // Own fields of Grl-0.1.Grl.DataClass
2903
+
2904
+ parent_class: GObject.ObjectClass
2905
+ }
2906
+
2907
+ /**
2908
+ * Grilo Data class
2909
+ * @record
2910
+ */
2911
+ export abstract class DataClass {
2912
+
2913
+ // Own properties of Grl-0.1.Grl.DataClass
2914
+
2915
+ static name: string
2916
+ }
2917
+
2918
+ export interface DataPrivate {
2919
+ }
2920
+
2921
+ export class DataPrivate {
2922
+
2923
+ // Own properties of Grl-0.1.Grl.DataPrivate
2924
+
2925
+ static name: string
2926
+ }
2927
+
2928
+ export interface LogDomain {
2929
+
2930
+ // Owm methods of Grl-0.1.Grl.LogDomain
2931
+
2932
+ free(): void
2933
+ }
2934
+
2935
+ export class LogDomain {
2936
+
2937
+ // Own properties of Grl-0.1.Grl.LogDomain
2938
+
2939
+ static name: string
2940
+ }
2941
+
2942
+ export interface MediaAudioClass {
2943
+
2944
+ // Own fields of Grl-0.1.Grl.MediaAudioClass
2945
+
2946
+ parent_class: MediaClass
2947
+ }
2948
+
2949
+ /**
2950
+ * Grilo Media audio Class
2951
+ * @record
2952
+ */
2953
+ export abstract class MediaAudioClass {
2954
+
2955
+ // Own properties of Grl-0.1.Grl.MediaAudioClass
2956
+
2957
+ static name: string
2958
+ }
2959
+
2960
+ export interface MediaBoxClass {
2961
+
2962
+ // Own fields of Grl-0.1.Grl.MediaBoxClass
2963
+
2964
+ parent_class: MediaClass
2965
+ }
2966
+
2967
+ /**
2968
+ * Grilo Media box Class
2969
+ * @record
2970
+ */
2971
+ export abstract class MediaBoxClass {
2972
+
2973
+ // Own properties of Grl-0.1.Grl.MediaBoxClass
2974
+
2975
+ static name: string
2976
+ }
2977
+
2978
+ export interface MediaClass {
2979
+
2980
+ // Own fields of Grl-0.1.Grl.MediaClass
2981
+
2982
+ parent_class: DataClass
2983
+ }
2984
+
2985
+ /**
2986
+ * Grilo Media Class
2987
+ * @record
2988
+ */
2989
+ export abstract class MediaClass {
2990
+
2991
+ // Own properties of Grl-0.1.Grl.MediaClass
2992
+
2993
+ static name: string
2994
+ }
2995
+
2996
+ export interface MediaImageClass {
2997
+
2998
+ // Own fields of Grl-0.1.Grl.MediaImageClass
2999
+
3000
+ parent_class: MediaClass
3001
+ }
3002
+
3003
+ /**
3004
+ * Grilo Media image Class
3005
+ * @record
3006
+ */
3007
+ export abstract class MediaImageClass {
3008
+
3009
+ // Own properties of Grl-0.1.Grl.MediaImageClass
3010
+
3011
+ static name: string
3012
+ }
3013
+
3014
+ export interface MediaPluginClass {
3015
+
3016
+ // Own fields of Grl-0.1.Grl.MediaPluginClass
3017
+
3018
+ parent_class: GObject.ObjectClass
3019
+ }
3020
+
3021
+ export abstract class MediaPluginClass {
3022
+
3023
+ // Own properties of Grl-0.1.Grl.MediaPluginClass
3024
+
3025
+ static name: string
3026
+ }
3027
+
3028
+ export interface MediaPluginPrivate {
3029
+ }
3030
+
3031
+ export class MediaPluginPrivate {
3032
+
3033
+ // Own properties of Grl-0.1.Grl.MediaPluginPrivate
3034
+
3035
+ static name: string
3036
+ }
3037
+
3038
+ export interface MediaSourceBrowseSpec {
3039
+
3040
+ // Own fields of Grl-0.1.Grl.MediaSourceBrowseSpec
3041
+
3042
+ source: MediaSource
3043
+ browse_id: number
3044
+ container: Media
3045
+ keys: any[]
3046
+ skip: number
3047
+ count: number
3048
+ flags: MetadataResolutionFlags
3049
+ callback: MediaSourceResultCb
3050
+ user_data: any
3051
+ }
3052
+
3053
+ /**
3054
+ * Data transport structure used internally by the plugins which support
3055
+ * browse vmethod.
3056
+ * @record
3057
+ */
3058
+ export class MediaSourceBrowseSpec {
3059
+
3060
+ // Own properties of Grl-0.1.Grl.MediaSourceBrowseSpec
3061
+
3062
+ static name: string
3063
+ }
3064
+
3065
+ export interface MediaSourceClass {
3066
+
3067
+ // Own fields of Grl-0.1.Grl.MediaSourceClass
3068
+
3069
+ parent_class: MetadataSourceClass
3070
+ browse: (source: MediaSource, bs: MediaSourceBrowseSpec) => void
3071
+ search: (source: MediaSource, ss: MediaSourceSearchSpec) => void
3072
+ query: (source: MediaSource, qs: MediaSourceQuerySpec) => void
3073
+ cancel: (source: MediaSource, operation_id: number) => void
3074
+ metadata: (source: MediaSource, ms: MediaSourceMetadataSpec) => void
3075
+ store: (source: MediaSource, ss: MediaSourceStoreSpec) => void
3076
+ remove: (source: MediaSource, ss: MediaSourceRemoveSpec) => void
3077
+ test_media_from_uri: (source: MediaSource, uri: string | null) => boolean
3078
+ media_from_uri: (source: MediaSource, mfss: MediaSourceMediaFromUriSpec) => void
3079
+ notify_change_start: (source: MediaSource) => boolean
3080
+ notify_change_stop: (source: MediaSource) => boolean
3081
+ }
3082
+
3083
+ /**
3084
+ * Grilo MediaSource class. Override the vmethods to implement the
3085
+ * source functionality.
3086
+ * @record
3087
+ */
3088
+ export abstract class MediaSourceClass {
3089
+
3090
+ // Own properties of Grl-0.1.Grl.MediaSourceClass
3091
+
3092
+ static name: string
3093
+ }
3094
+
3095
+ export interface MediaSourceMediaFromUriSpec {
3096
+
3097
+ // Own fields of Grl-0.1.Grl.MediaSourceMediaFromUriSpec
3098
+
3099
+ source: MediaSource
3100
+ media_from_uri_id: number
3101
+ uri: string | null
3102
+ keys: any[]
3103
+ flags: MetadataResolutionFlags
3104
+ callback: MediaSourceMetadataCb
3105
+ user_data: any
3106
+ }
3107
+
3108
+ /**
3109
+ * Data transport structure used internally by the plugins which support
3110
+ * media_from_uri vmethod.
3111
+ * @record
3112
+ */
3113
+ export class MediaSourceMediaFromUriSpec {
3114
+
3115
+ // Own properties of Grl-0.1.Grl.MediaSourceMediaFromUriSpec
3116
+
3117
+ static name: string
3118
+ }
3119
+
3120
+ export interface MediaSourceMetadataSpec {
3121
+
3122
+ // Own fields of Grl-0.1.Grl.MediaSourceMetadataSpec
3123
+
3124
+ source: MediaSource
3125
+ metadata_id: number
3126
+ media: Media
3127
+ keys: any[]
3128
+ flags: MetadataResolutionFlags
3129
+ callback: MediaSourceMetadataCb
3130
+ user_data: any
3131
+ }
3132
+
3133
+ /**
3134
+ * Data transport structure used internally by the plugins which support
3135
+ * metadata vmethod.
3136
+ * @record
3137
+ */
3138
+ export class MediaSourceMetadataSpec {
3139
+
3140
+ // Own properties of Grl-0.1.Grl.MediaSourceMetadataSpec
3141
+
3142
+ static name: string
3143
+ }
3144
+
3145
+ export interface MediaSourcePrivate {
3146
+ }
3147
+
3148
+ export class MediaSourcePrivate {
3149
+
3150
+ // Own properties of Grl-0.1.Grl.MediaSourcePrivate
3151
+
3152
+ static name: string
3153
+ }
3154
+
3155
+ export interface MediaSourceQuerySpec {
3156
+
3157
+ // Own fields of Grl-0.1.Grl.MediaSourceQuerySpec
3158
+
3159
+ source: MediaSource
3160
+ query_id: number
3161
+ query: string | null
3162
+ keys: any[]
3163
+ skip: number
3164
+ count: number
3165
+ flags: MetadataResolutionFlags
3166
+ callback: MediaSourceResultCb
3167
+ user_data: any
3168
+ }
3169
+
3170
+ /**
3171
+ * Data transport structure used internally by the plugins which support
3172
+ * query vmethod.
3173
+ * @record
3174
+ */
3175
+ export class MediaSourceQuerySpec {
3176
+
3177
+ // Own properties of Grl-0.1.Grl.MediaSourceQuerySpec
3178
+
3179
+ static name: string
3180
+ }
3181
+
3182
+ export interface MediaSourceRemoveSpec {
3183
+
3184
+ // Own fields of Grl-0.1.Grl.MediaSourceRemoveSpec
3185
+
3186
+ source: MediaSource
3187
+ media_id: string | null
3188
+ media: Media
3189
+ callback: MediaSourceRemoveCb
3190
+ user_data: any
3191
+ }
3192
+
3193
+ /**
3194
+ * Data transport structure used internally by the plugins which support
3195
+ * store vmethod.
3196
+ * @record
3197
+ */
3198
+ export class MediaSourceRemoveSpec {
3199
+
3200
+ // Own properties of Grl-0.1.Grl.MediaSourceRemoveSpec
3201
+
3202
+ static name: string
3203
+ }
3204
+
3205
+ export interface MediaSourceSearchSpec {
3206
+
3207
+ // Own fields of Grl-0.1.Grl.MediaSourceSearchSpec
3208
+
3209
+ source: MediaSource
3210
+ search_id: number
3211
+ text: string | null
3212
+ keys: any[]
3213
+ skip: number
3214
+ count: number
3215
+ flags: MetadataResolutionFlags
3216
+ callback: MediaSourceResultCb
3217
+ user_data: any
3218
+ }
3219
+
3220
+ /**
3221
+ * Data transport structure used internally by the plugins which support
3222
+ * search vmethod.
3223
+ * @record
3224
+ */
3225
+ export class MediaSourceSearchSpec {
3226
+
3227
+ // Own properties of Grl-0.1.Grl.MediaSourceSearchSpec
3228
+
3229
+ static name: string
3230
+ }
3231
+
3232
+ export interface MediaSourceStoreSpec {
3233
+
3234
+ // Own fields of Grl-0.1.Grl.MediaSourceStoreSpec
3235
+
3236
+ source: MediaSource
3237
+ parent: MediaBox
3238
+ media: Media
3239
+ callback: MediaSourceStoreCb
3240
+ user_data: any
3241
+ }
3242
+
3243
+ /**
3244
+ * Data transport structure used internally by the plugins which support
3245
+ * store vmethod.
3246
+ * @record
3247
+ */
3248
+ export class MediaSourceStoreSpec {
3249
+
3250
+ // Own properties of Grl-0.1.Grl.MediaSourceStoreSpec
3251
+
3252
+ static name: string
3253
+ }
3254
+
3255
+ export interface MediaVideoClass {
3256
+
3257
+ // Own fields of Grl-0.1.Grl.MediaVideoClass
3258
+
3259
+ parent_class: MediaClass
3260
+ }
3261
+
3262
+ /**
3263
+ * Grilo Media video Class
3264
+ * @record
3265
+ */
3266
+ export abstract class MediaVideoClass {
3267
+
3268
+ // Own properties of Grl-0.1.Grl.MediaVideoClass
3269
+
3270
+ static name: string
3271
+ }
3272
+
3273
+ export interface MetadataSourceClass {
3274
+
3275
+ // Own fields of Grl-0.1.Grl.MetadataSourceClass
3276
+
3277
+ parent_class: MediaPluginClass
3278
+ operation_id: number
3279
+ supported_operations: (source: MetadataSource) => SupportedOps
3280
+ supported_keys: (source: MetadataSource) => GObject.ParamSpec[]
3281
+ slow_keys: (source: MetadataSource) => GObject.ParamSpec[]
3282
+ key_depends: (source: MetadataSource, key_id: GObject.ParamSpec) => GObject.ParamSpec[]
3283
+ writable_keys: (source: MetadataSource) => GObject.ParamSpec[]
3284
+ resolve: (source: MetadataSource, rs: MetadataSourceResolveSpec) => void
3285
+ set_metadata: (source: MetadataSource, sms: MetadataSourceSetMetadataSpec) => void
3286
+ may_resolve: (source: MetadataSource, media: Media, key_id: KeyID) => [ /* returnType */ boolean, /* missing_keys */ KeyID[] ]
3287
+ cancel: (source: MetadataSource, operation_id: number) => void
3288
+ }
3289
+
3290
+ /**
3291
+ * Grilo MetadataSource class. Override the vmethods to implement the
3292
+ * element functionality.
3293
+ * @record
3294
+ */
3295
+ export abstract class MetadataSourceClass {
3296
+
3297
+ // Own properties of Grl-0.1.Grl.MetadataSourceClass
3298
+
3299
+ static name: string
3300
+ }
3301
+
3302
+ export interface MetadataSourcePrivate {
3303
+ }
3304
+
3305
+ export class MetadataSourcePrivate {
3306
+
3307
+ // Own properties of Grl-0.1.Grl.MetadataSourcePrivate
3308
+
3309
+ static name: string
3310
+ }
3311
+
3312
+ export interface MetadataSourceResolveSpec {
3313
+
3314
+ // Own fields of Grl-0.1.Grl.MetadataSourceResolveSpec
3315
+
3316
+ source: MetadataSource
3317
+ resolve_id: number
3318
+ keys: any[]
3319
+ media: Media
3320
+ flags: MetadataResolutionFlags
3321
+ callback: MetadataSourceResolveCb
3322
+ user_data: any
3323
+ }
3324
+
3325
+ /**
3326
+ * Represents the closure used by the derived objects to fetch, store and
3327
+ * return the transfer object to the client's code.
3328
+ * @record
3329
+ */
3330
+ export class MetadataSourceResolveSpec {
3331
+
3332
+ // Own properties of Grl-0.1.Grl.MetadataSourceResolveSpec
3333
+
3334
+ static name: string
3335
+ }
3336
+
3337
+ export interface MetadataSourceSetMetadataSpec {
3338
+
3339
+ // Own fields of Grl-0.1.Grl.MetadataSourceSetMetadataSpec
3340
+
3341
+ source: MetadataSource
3342
+ media: Media
3343
+ keys: any[]
3344
+ flags: MetadataWritingFlags
3345
+ callback: MetadataSourceSetMetadataCb
3346
+ user_data: any
3347
+ failed_keys: any[]
3348
+ }
3349
+
3350
+ /**
3351
+ * Represents the closure used by the derived objects to operate.
3352
+ * @record
3353
+ */
3354
+ export class MetadataSourceSetMetadataSpec {
3355
+
3356
+ // Own properties of Grl-0.1.Grl.MetadataSourceSetMetadataSpec
3357
+
3358
+ static name: string
3359
+ }
3360
+
3361
+ export interface PluginDescriptor {
3362
+
3363
+ // Own fields of Grl-0.1.Grl.PluginDescriptor
3364
+
3365
+ plugin_id: string | null
3366
+ plugin_deinit: () => void
3367
+ module: GModule.Module
3368
+ }
3369
+
3370
+ export class PluginDescriptor {
3371
+
3372
+ // Own properties of Grl-0.1.Grl.PluginDescriptor
3373
+
3374
+ static name: string
3375
+ }
3376
+
3377
+ export interface PluginInfo {
3378
+
3379
+ // Own fields of Grl-0.1.Grl.PluginInfo
3380
+
3381
+ id: string | null
3382
+ filename: string | null
3383
+ optional_info: GLib.HashTable
3384
+ rank: number
3385
+ }
3386
+
3387
+ /**
3388
+ * This structure stores the information related to a module
3389
+ * @record
3390
+ */
3391
+ export class PluginInfo {
3392
+
3393
+ // Own properties of Grl-0.1.Grl.PluginInfo
3394
+
3395
+ static name: string
3396
+ }
3397
+
3398
+ export interface PluginRegistryClass {
3399
+
3400
+ // Own fields of Grl-0.1.Grl.PluginRegistryClass
3401
+
3402
+ parent_class: GObject.ObjectClass
3403
+ }
3404
+
3405
+ /**
3406
+ * Grilo PluginRegistry class. Dynamic loader of plugins.
3407
+ * @record
3408
+ */
3409
+ export abstract class PluginRegistryClass {
3410
+
3411
+ // Own properties of Grl-0.1.Grl.PluginRegistryClass
3412
+
3413
+ static name: string
3414
+ }
3415
+
3416
+ export interface PluginRegistryPrivate {
3417
+ }
3418
+
3419
+ export class PluginRegistryPrivate {
3420
+
3421
+ // Own properties of Grl-0.1.Grl.PluginRegistryPrivate
3422
+
3423
+ static name: string
3424
+ }
3425
+
3426
+ export interface RelatedKeysClass {
3427
+
3428
+ // Own fields of Grl-0.1.Grl.RelatedKeysClass
3429
+
3430
+ parent_class: GObject.ObjectClass
3431
+ }
3432
+
3433
+ /**
3434
+ * Grilo Data Multivalued class
3435
+ * @record
3436
+ */
3437
+ export abstract class RelatedKeysClass {
3438
+
3439
+ // Own properties of Grl-0.1.Grl.RelatedKeysClass
3440
+
3441
+ static name: string
3442
+ }
3443
+
3444
+ export interface RelatedKeysPrivate {
3445
+ }
3446
+
3447
+ export class RelatedKeysPrivate {
3448
+
3449
+ // Own properties of Grl-0.1.Grl.RelatedKeysPrivate
3450
+
3451
+ static name: string
3452
+ }
3453
+
3454
+ export type KeyID = any
3455
+ /**
3456
+ * Name of the imported GIR library
3457
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
3458
+ */
3459
+ export const __name__: string
3460
+ /**
3461
+ * Version of the imported GIR library
3462
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
3463
+ */
3464
+ export const __version__: string
3465
+ // END