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