@girs/grl-0.2 0.2.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.2.d.cts ADDED
@@ -0,0 +1,4461 @@
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.2
10
+ */
11
+
12
+ import type Gio from '@girs/gio-2.0';
13
+ import type GObject from '@girs/gobject-2.0';
14
+ import type GLib from '@girs/glib-2.0';
15
+ import type GModule from '@girs/gmodule-2.0';
16
+
17
+ /**
18
+ * These constants identify all the available core errors
19
+ */
20
+ export enum CoreError {
21
+ /**
22
+ * The browse operation failed
23
+ */
24
+ BROWSE_FAILED,
25
+ /**
26
+ * The search operation failed
27
+ */
28
+ SEARCH_FAILED,
29
+ /**
30
+ * Searching NULL-text is not supported
31
+ */
32
+ SEARCH_NULL_UNSUPPORTED,
33
+ /**
34
+ * The query operation failed
35
+ */
36
+ QUERY_FAILED,
37
+ /**
38
+ * The resolution operation failed
39
+ */
40
+ RESOLVE_FAILED,
41
+ /**
42
+ * The media was not found
43
+ */
44
+ MEDIA_NOT_FOUND,
45
+ /**
46
+ * The store operation failed
47
+ */
48
+ STORE_FAILED,
49
+ /**
50
+ * The store metadata operation failed
51
+ */
52
+ STORE_METADATA_FAILED,
53
+ /**
54
+ * The removal operation failed
55
+ */
56
+ REMOVE_FAILED,
57
+ /**
58
+ * The media from_uri operation failed
59
+ */
60
+ MEDIA_FROM_URI_FAILED,
61
+ /**
62
+ * Failed to load plugin configuration from a file
63
+ */
64
+ CONFIG_LOAD_FAILED,
65
+ /**
66
+ * Failed to set configuration for plugin
67
+ */
68
+ CONFIG_FAILED,
69
+ /**
70
+ * Failed to unregister source
71
+ */
72
+ UNREGISTER_SOURCE_FAILED,
73
+ /**
74
+ * Failed to load plugin
75
+ */
76
+ LOAD_PLUGIN_FAILED,
77
+ /**
78
+ * Failed to unload plugin
79
+ */
80
+ UNLOAD_PLUGIN_FAILED,
81
+ /**
82
+ * Failed to register metadata key
83
+ */
84
+ REGISTER_METADATA_KEY_FAILED,
85
+ /**
86
+ * Failed to start changed notifications
87
+ */
88
+ NOTIFY_CHANGED_FAILED,
89
+ /**
90
+ * The operation was cancelled
91
+ */
92
+ OPERATION_CANCELLED,
93
+ /**
94
+ * Invalid authentication token
95
+ */
96
+ AUTHENTICATION_TOKEN,
97
+ }
98
+ /**
99
+ * Grilo log levels. Defines the level of verbosity selected in Grilo.
100
+ */
101
+ export enum LogLevel {
102
+ /**
103
+ * Log level none
104
+ */
105
+ NONE,
106
+ /**
107
+ * Log on error
108
+ */
109
+ ERROR,
110
+ /**
111
+ * Log on warning
112
+ */
113
+ WARNING,
114
+ /**
115
+ * Log on message
116
+ */
117
+ MESSAGE,
118
+ /**
119
+ * Log on info
120
+ */
121
+ INFO,
122
+ /**
123
+ * Log on debug
124
+ */
125
+ DEBUG,
126
+ /**
127
+ * Last level of log
128
+ */
129
+ LAST,
130
+ }
131
+ /**
132
+ * GrlMedia serialize type
133
+ */
134
+ export enum MediaSerializeType {
135
+ /**
136
+ * Basic mode
137
+ */
138
+ BASIC,
139
+ /**
140
+ * Partial mode
141
+ */
142
+ PARTIAL,
143
+ /**
144
+ * Full mode
145
+ */
146
+ FULL,
147
+ }
148
+ /**
149
+ * Source priority ranks. Defines the order in which the resolver
150
+ * (or similar rank-picking mechanisms) will choose this source
151
+ * over an alternative one with the same function.
152
+ *
153
+ * These constants serve as a rough guidance for defining the rank
154
+ * of a GrlSource. Any value is valid, including values bigger
155
+ * than GRL_RANK_HIGHEST.
156
+ */
157
+ export enum Rank {
158
+ /**
159
+ * will be chosen last or not at all
160
+ */
161
+ LOWEST,
162
+ /**
163
+ * unlikely to be chosen
164
+ */
165
+ LOW,
166
+ /**
167
+ * likely to be chosen
168
+ */
169
+ DEFAULT,
170
+ /**
171
+ * will be chosen
172
+ */
173
+ HIGH,
174
+ /**
175
+ * will be chosen first
176
+ */
177
+ HIGHEST,
178
+ }
179
+ /**
180
+ * Specifies which kind of change has happened in the plugin
181
+ */
182
+ export enum SourceChangeType {
183
+ /**
184
+ * content has changed. It is used when any property of
185
+ * #GrlMedia has changed, or in case of #GrlMediaBox, if several children have
186
+ * been added and removed.
187
+ */
188
+ CHANGED,
189
+ /**
190
+ * new content has been added.
191
+ */
192
+ ADDED,
193
+ /**
194
+ * content has been removed
195
+ */
196
+ REMOVED,
197
+ }
198
+ export enum MediaType {
199
+ /**
200
+ * no media
201
+ */
202
+ NONE,
203
+ /**
204
+ * audio media
205
+ */
206
+ AUDIO,
207
+ /**
208
+ * video media
209
+ */
210
+ VIDEO,
211
+ /**
212
+ * image media
213
+ */
214
+ IMAGE,
215
+ /**
216
+ * any media
217
+ */
218
+ ALL,
219
+ }
220
+ /**
221
+ * Resolution flags
222
+ * @bitfield
223
+ */
224
+ export enum ResolutionFlags {
225
+ /**
226
+ * Normal mode.
227
+ */
228
+ NORMAL,
229
+ /**
230
+ * Try other plugins if necessary.
231
+ */
232
+ FULL,
233
+ /**
234
+ * Use idle loop to relay results.
235
+ */
236
+ IDLE_RELAY,
237
+ /**
238
+ * Only resolve fast metadata keys.
239
+ */
240
+ FAST_ONLY,
241
+ }
242
+ /**
243
+ * Bitwise flags which reflect the kind of operations that a
244
+ * #GrlSource supports.
245
+ * @bitfield
246
+ */
247
+ export enum SupportedOps {
248
+ /**
249
+ * no operation is supported
250
+ */
251
+ NONE,
252
+ /**
253
+ * Fetch specific keys of metadata based on other metadata.
254
+ */
255
+ RESOLVE,
256
+ /**
257
+ * Retrieve complete sets of #GrlMedia
258
+ */
259
+ BROWSE,
260
+ /**
261
+ * Look up for #GrlMedia given a search text
262
+ */
263
+ SEARCH,
264
+ /**
265
+ * Look up for #GrlMedia give a service specific query
266
+ */
267
+ QUERY,
268
+ /**
269
+ * Store content in a service
270
+ */
271
+ STORE,
272
+ /**
273
+ * Store content as child of a certian parent category.
274
+ */
275
+ STORE_PARENT,
276
+ /**
277
+ * Update metadata of a #GrlMedia in a service.
278
+ */
279
+ STORE_METADATA,
280
+ /**
281
+ * Remove content from a service.
282
+ */
283
+ REMOVE,
284
+ /**
285
+ * Create a #GrlMedia instance from an URI
286
+ * representing a media resource.
287
+ */
288
+ MEDIA_FROM_URI,
289
+ /**
290
+ * Notify about changes in the #GrlSource.
291
+ */
292
+ NOTIFY_CHANGE,
293
+ }
294
+ /**
295
+ * Type of media to allow.
296
+ * @bitfield
297
+ */
298
+ export enum TypeFilter {
299
+ /**
300
+ * allow no content (only #GrlMediaBox)
301
+ */
302
+ NONE,
303
+ /**
304
+ * allow audio content
305
+ */
306
+ AUDIO,
307
+ /**
308
+ * allow video content
309
+ */
310
+ VIDEO,
311
+ /**
312
+ * allow image content
313
+ */
314
+ IMAGE,
315
+ /**
316
+ * allow any type of content
317
+ */
318
+ ALL,
319
+ }
320
+ /**
321
+ * Flags for writing operations.
322
+ * @bitfield
323
+ */
324
+ export enum WriteFlags {
325
+ /**
326
+ * Normal mode.
327
+ */
328
+ NORMAL,
329
+ /**
330
+ * Try other plugins if necessary.
331
+ */
332
+ FULL,
333
+ }
334
+ export const CONFIG_KEY_APIKEY: string | null
335
+ export const CONFIG_KEY_APIKEY_BLOB: string | null
336
+ export const CONFIG_KEY_APISECRET: string | null
337
+ export const CONFIG_KEY_APITOKEN: string | null
338
+ export const CONFIG_KEY_APITOKEN_SECRET: string | null
339
+ export const CONFIG_KEY_PASSWORD: string | null
340
+ export const CONFIG_KEY_PLUGIN: string | null
341
+ export const CONFIG_KEY_SOURCE: string | null
342
+ export const CONFIG_KEY_USERNAME: string | null
343
+ export const COUNT_INFINITY: number
344
+ export const KEYID_FORMAT: string | null
345
+ export const METADATA_KEY_ALBUM: number
346
+ export const METADATA_KEY_ARTIST: number
347
+ export const METADATA_KEY_AUDIO_TRACK: number
348
+ export const METADATA_KEY_AUTHOR: number
349
+ export const METADATA_KEY_BITRATE: number
350
+ export const METADATA_KEY_CAMERA_MODEL: number
351
+ export const METADATA_KEY_CERTIFICATE: number
352
+ export const METADATA_KEY_CHILDCOUNT: number
353
+ export const METADATA_KEY_CHILDCOUNT_UNKNOWN: number
354
+ export const METADATA_KEY_CREATION_DATE: number
355
+ export const METADATA_KEY_DESCRIPTION: number
356
+ export const METADATA_KEY_DIRECTOR: number
357
+ export const METADATA_KEY_DURATION: number
358
+ export const METADATA_KEY_EPISODE: number
359
+ export const METADATA_KEY_EPISODE_TITLE: number
360
+ export const METADATA_KEY_EXPOSURE_TIME: number
361
+ export const METADATA_KEY_EXTERNAL_PLAYER: number
362
+ export const METADATA_KEY_EXTERNAL_URL: number
363
+ export const METADATA_KEY_FAVOURITE: number
364
+ export const METADATA_KEY_FLASH_USED: number
365
+ export const METADATA_KEY_FRAMERATE: number
366
+ export const METADATA_KEY_GENRE: number
367
+ export const METADATA_KEY_HEIGHT: number
368
+ export const METADATA_KEY_ID: number
369
+ export const METADATA_KEY_INVALID: number
370
+ export const METADATA_KEY_ISO_SPEED: number
371
+ export const METADATA_KEY_KEYWORD: number
372
+ export const METADATA_KEY_LAST_PLAYED: number
373
+ export const METADATA_KEY_LAST_POSITION: number
374
+ export const METADATA_KEY_LICENSE: number
375
+ export const METADATA_KEY_LYRICS: number
376
+ export const METADATA_KEY_MB_ALBUM_ID: number
377
+ export const METADATA_KEY_MB_ARTIST_ID: number
378
+ export const METADATA_KEY_MB_RECORDING_ID: number
379
+ export const METADATA_KEY_MB_TRACK_ID: number
380
+ export const METADATA_KEY_MIME: number
381
+ export const METADATA_KEY_MODIFICATION_DATE: number
382
+ export const METADATA_KEY_ORIENTATION: number
383
+ export const METADATA_KEY_ORIGINAL_TITLE: number
384
+ export const METADATA_KEY_PERFORMER: number
385
+ export const METADATA_KEY_PLAY_COUNT: number
386
+ export const METADATA_KEY_PRODUCER: number
387
+ export const METADATA_KEY_PUBLICATION_DATE: number
388
+ export const METADATA_KEY_RATING: number
389
+ export const METADATA_KEY_REGION: number
390
+ export const METADATA_KEY_SEASON: number
391
+ export const METADATA_KEY_SHOW: number
392
+ export const METADATA_KEY_SITE: number
393
+ export const METADATA_KEY_SIZE: number
394
+ export const METADATA_KEY_SOURCE: number
395
+ export const METADATA_KEY_START_TIME: number
396
+ export const METADATA_KEY_STUDIO: number
397
+ export const METADATA_KEY_THUMBNAIL: number
398
+ export const METADATA_KEY_THUMBNAIL_BINARY: number
399
+ export const METADATA_KEY_TITLE: number
400
+ export const METADATA_KEY_TITLE_FROM_FILENAME: number
401
+ export const METADATA_KEY_TRACK_NUMBER: number
402
+ export const METADATA_KEY_URL: number
403
+ export const METADATA_KEY_WIDTH: number
404
+ export const OPERATION_OPTION_COUNT: string | null
405
+ export const OPERATION_OPTION_KEY_EQUAL_FILTER: string | null
406
+ export const OPERATION_OPTION_KEY_RANGE_FILTER: string | null
407
+ export const OPERATION_OPTION_RESOLUTION_FLAGS: string | null
408
+ export const OPERATION_OPTION_SKIP: string | null
409
+ export const OPERATION_OPTION_TYPE_FILTER: string | null
410
+ export const PADDING: number
411
+ export const PADDING_SMALL: number
412
+ export const PLUGIN_AUTHOR: string | null
413
+ export const PLUGIN_DESCRIPTION: string | null
414
+ export const PLUGIN_LICENSE: string | null
415
+ export const PLUGIN_LIST_VAR: string | null
416
+ export const PLUGIN_NAME: string | null
417
+ export const PLUGIN_PATH_VAR: string | null
418
+ export const PLUGIN_RANKS_VAR: string | null
419
+ export const PLUGIN_SITE: string | null
420
+ export const PLUGIN_VERSION: string | null
421
+ export const SOURCE_REMAINING_UNKNOWN: number
422
+ export function date_time_from_iso8601(date: string | null): GLib.DateTime
423
+ /**
424
+ * Deinitializes the Grilo library.
425
+ *
426
+ * Call this function after finalizing using Grilo, in order to free and clean
427
+ * up all the resources created.
428
+ */
429
+ export function deinit(): void
430
+ export function g_value_dup(value: any): any
431
+ export function g_value_free(value: any): void
432
+ export function g_value_hashtable_new(): GLib.HashTable
433
+ export function g_value_hashtable_new_direct(): GLib.HashTable
434
+ export function g_value_new(g_type: GObject.GType): any
435
+ /**
436
+ * Initializes the Grilo library
437
+ * @param argv list of arguments
438
+ */
439
+ export function init(argv: string[] | null): /* argv */ string[] | null
440
+ /**
441
+ * Returns a #GOptionGroup with Grilo's argument specifications.
442
+ *
443
+ * This function is useful if you want to integrate Grilo with other
444
+ * libraries that use the GOption commandline parser
445
+ * (see g_option_context_add_group() ).
446
+ * @returns a pointer to Grilo's option group. Should be dereferenced after use.
447
+ */
448
+ export function init_get_option_group(): GLib.OptionGroup
449
+ /**
450
+ * Configure a set of log domains. The default configuration is to display
451
+ * warning and error messages only for all the log domains.
452
+ *
453
+ * The configuration string follows the following grammar:
454
+ *
455
+ *
456
+ * ```
457
+ * config-list: config | config ',' config-list
458
+ * config: domain ':' level
459
+ * domain: '*' | [a-zA-Z0-9]+
460
+ * level: '*' | '-' | named-level | num-level
461
+ * named-level: "none" | "error" | "warning" | "message" | "info" | "debug"
462
+ * num-level: [0-5]
463
+ * ```
464
+ *
465
+ *
466
+ * examples:
467
+ * <itemizedlist>
468
+ * <listitem><para>"*:*": maximum verbosity for all the log domains</para>
469
+ * </listitem>
470
+ * <listitem><para>"*:-": don't print any message</para></listitem>
471
+ * <listitem><para>"media-source:debug,metadata-source:debug": prints debug,
472
+ * info, message warning and error messages for the media-source and
473
+ * metadata-source log domains</para></listitem>
474
+ * </itemizedlist>
475
+ *
476
+ * <note>It's possible to override the log configuration at runtime by
477
+ * defining the GRL_DEBUG environment variable to a configuration string
478
+ * as described above</note>
479
+ * @param config A string describing the wanted log configuration
480
+ */
481
+ export function log_configure(config: string | null): void
482
+ export function marshal_VOID__BOXED_ENUM_BOOLEAN(closure: GObject.TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null): void
483
+ /**
484
+ * Retrieves the description associated with the key
485
+ * @param key key to look up
486
+ * @returns the description of the key
487
+ */
488
+ export function metadata_key_get_desc(key: KeyID): string | null
489
+ /**
490
+ * Retrieves the name associated with the key
491
+ * @param key key to look up
492
+ * @returns The name of the key
493
+ */
494
+ export function metadata_key_get_name(key: KeyID): string | null
495
+ /**
496
+ * Retrieves the expected type for values associated with this key
497
+ * @param key key to look up
498
+ * @returns the expected value type
499
+ */
500
+ export function metadata_key_get_type(key: KeyID): GObject.GType
501
+ export function metadata_key_setup_system_keys(registry: Registry): void
502
+ /**
503
+ * Goes though all available media sources until it finds one capable of
504
+ * constructing a GrlMedia object representing the media resource exposed
505
+ * by `uri`.
506
+ *
507
+ * This method is asynchronous.
508
+ * @param uri A URI that can be used to identify a media resource
509
+ * @param keys List of metadata keys we want to obtain.
510
+ * @param options options wanted for that operation
511
+ * @param callback the user defined callback
512
+ */
513
+ export function multiple_get_media_from_uri(uri: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResolveCb): void
514
+ /**
515
+ * Search for `text` in all the sources specified in `sources`.
516
+ *
517
+ * If `text` is `NULL` then NULL-text searchs will be used for each searchable
518
+ * plugin (see #grl_source_search for more details).
519
+ *
520
+ * This method is asynchronous.
521
+ * @param sources a #GList of #GrlSource<!-- -->s to search from (%NULL for all searchable sources)
522
+ * @param text the text to search for
523
+ * @param keys the #GList of #GrlKeyID to retrieve
524
+ * @param options options wanted for that operation
525
+ * @param callback the user defined callback
526
+ * @returns the operation identifier
527
+ */
528
+ export function multiple_search(sources: Source[] | null, text: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
529
+ /**
530
+ * Search for `text` in all the sources specified in `sources`.
531
+ *
532
+ * This method is synchronous.
533
+ * @param sources a #GList of #GrlSource<!-- -->s where to search from (%NULL for all available sources with search capability)
534
+ * @param text the text to search for
535
+ * @param keys the #GList of #GrlKeyID to retrieve
536
+ * @param options options wanted for that operation
537
+ * @returns a list with #GrlMedia elements
538
+ */
539
+ export function multiple_search_sync(sources: Source[] | null, text: string | null, keys: KeyID[], options: OperationOptions): Media[]
540
+ /**
541
+ * Cancel an operation.
542
+ * @param operation_id the identifier of a running operation
543
+ */
544
+ export function operation_cancel(operation_id: number): void
545
+ export function operation_generate_id(): number
546
+ /**
547
+ * Obtains the previously attached data
548
+ * @param operation_id the identifier of a running operation
549
+ * @returns The previously attached data.
550
+ */
551
+ export function operation_get_data(operation_id: number): any | null
552
+ export function operation_init(): void
553
+ export function operation_remove(operation_id: number): void
554
+ /**
555
+ * Attach a pointer to the specific operation.
556
+ * @param operation_id the identifier of a running operation
557
+ * @param user_data the data to attach
558
+ */
559
+ export function operation_set_data(operation_id: number, user_data: any | null): void
560
+ /**
561
+ * Attach a pointer to the specific operation.
562
+ *
563
+ * Note that the `destroy_func` callback is not called if `user_data` is %NULL.
564
+ * @param operation_id the identifier of a running operation
565
+ * @param user_data the data to attach
566
+ * @param destroy_func function to release `user_data` when the operation terminates
567
+ */
568
+ export function operation_set_data_full(operation_id: number, user_data: any | null, destroy_func: GLib.DestroyNotify | null): void
569
+ export function operation_set_private_data(operation_id: number, private_data: any | null, cancel_cb: OperationCancelCb): void
570
+ /**
571
+ * Grilo browsing implements a paging mechanism through `skip` and `count` values.
572
+ *
573
+ * But there are some services (like Jamendo or Flickr) where paging is done
574
+ * through a page number and page size: user request all elements in a page,
575
+ * specifying in most cases what is the page size.
576
+ *
577
+ * This function is a helper for this task, computing from `skip` and `count` what
578
+ * is the optimal value of page size (limited by `max_page_size)`, which page
579
+ * should the user request, and where requested data start inside the page.
580
+ *
581
+ * By optimal we mean that it computes those values so only one page is required
582
+ * to satisfy the data, using the smallest page size. If user is limiting page
583
+ * size, then more requests to services might be needed. But still page size
584
+ * will be an optimal value.
585
+ *
586
+ * If `page_size` is `NULL,` then page size will be `max_page_size`. If the later
587
+ * is also 0, then page size will be #G_MAXUINT.
588
+ * @param skip number of elements to skip
589
+ * @param count number of elements to retrieve
590
+ * @param max_page_size maximum value for page size (0 for unlimited size)
591
+ * @param page_size optimal page size
592
+ * @param page_number page which contain the first element to retrieve (starting at 1)
593
+ * @param internal_offset in the `page_number,` offset where first element can be found (starting at 0)
594
+ */
595
+ export function paging_translate(skip: number, count: number, max_page_size: number, page_size: number, page_number: number, internal_offset: number): void
596
+ export function range_value_hashtable_insert(hash_table: GLib.HashTable, key: any | null, min: any, max: any): void
597
+ export function range_value_hashtable_new(): GLib.HashTable
598
+ export interface OperationCancelCb {
599
+ (data: any | null): void
600
+ }
601
+ /**
602
+ * Prototype for the callback passed to grl_source_remove()
603
+ * @callback
604
+ * @param source a source
605
+ * @param media a data transfer object
606
+ * @param error possible #GError generated at processing
607
+ */
608
+ export interface SourceRemoveCb {
609
+ (source: Source, media: Media, error: GLib.Error | null): void
610
+ }
611
+ /**
612
+ * Prototype for the callback passed to grl_source_resolve(). If the URI did
613
+ * not resolve to a valid media record, `media` will be %NULL. If there was an
614
+ * error during resolution, `error` will be set.
615
+ *
616
+ * If `media` is non-%NULL, ownership of it is transferred to the callback, and
617
+ * it must be freed afterwards using g_object_unref().
618
+ * @callback
619
+ * @param source a source
620
+ * @param operation_id operation identifier
621
+ * @param media a data transfer object
622
+ * @param error possible #GError generated at processing
623
+ */
624
+ export interface SourceResolveCb {
625
+ (source: Source, operation_id: number, media: Media, error: GLib.Error | null): void
626
+ }
627
+ /**
628
+ * Prototype for the callback passed to the media sources' methods
629
+ * @callback
630
+ * @param source a source
631
+ * @param operation_id operation identifier
632
+ * @param media a data transfer object
633
+ * @param remaining the number of remaining #GrlMedia to process, or GRL_SOURCE_REMAINING_UNKNOWN if it is unknown
634
+ * @param error possible #GError generated at processing
635
+ */
636
+ export interface SourceResultCb {
637
+ (source: Source, operation_id: number, media: Media | null, remaining: number, error: GLib.Error | null): void
638
+ }
639
+ /**
640
+ * Prototype for the callback passed to grl_source_store_foo functions
641
+ * @callback
642
+ * @param source a source
643
+ * @param media a #GrlMedia transfer object
644
+ * @param failed_keys #GList of keys that could not be updated, if any
645
+ * @param error possible #GError generated
646
+ */
647
+ export interface SourceStoreCb {
648
+ (source: Source, media: Media, failed_keys: KeyID[], error: GLib.Error | null): void
649
+ }
650
+ export module Caps {
651
+
652
+ // Constructor properties interface
653
+
654
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
655
+ }
656
+
657
+ }
658
+
659
+ export interface Caps {
660
+
661
+ // Own fields of Grl-0.2.Grl.Caps
662
+
663
+ parent: GObject.Object
664
+
665
+ // Owm methods of Grl-0.2.Grl.Caps
666
+
667
+ get_key_filter(): KeyID[]
668
+ get_key_range_filter(): KeyID[]
669
+ get_type_filter(): TypeFilter
670
+ /**
671
+ * Checks if `key` is supported for filtering in `caps`.
672
+ * @param key a #GrlKeyID
673
+ * @returns %TRUE if @key can be used for filtering
674
+ */
675
+ is_key_filter(key: KeyID): boolean
676
+ /**
677
+ * Checks if `key` is supported for filtering by range in `caps`.
678
+ * @param key a #GrlKeyID
679
+ * @returns %TRUE if @key can be used for filtering
680
+ */
681
+ is_key_range_filter(key: KeyID): boolean
682
+ set_key_filter(keys: KeyID[]): void
683
+ set_key_range_filter(keys: KeyID[]): void
684
+ /**
685
+ * Sets the supported filter capability.
686
+ * @param filter a #GrlTypeFilter
687
+ */
688
+ set_type_filter(filter: TypeFilter): void
689
+ /**
690
+ * Checks whether (`key,` `value)` are authorized by `caps`.
691
+ * @param key a key to test
692
+ * @param value the value corresponding to `key` to test against `caps`
693
+ * @returns %TRUE if (@key, @value) obey to @caps, %FALSE otherwise.
694
+ */
695
+ test_option(key: string | null, value: any): boolean
696
+
697
+ // Class property signals of Grl-0.2.Grl.Caps
698
+
699
+ connect(sigName: string, callback: (...args: any[]) => void): number
700
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
701
+ emit(sigName: string, ...args: any[]): void
702
+ disconnect(id: number): void
703
+ }
704
+
705
+ export class Caps extends GObject.Object {
706
+
707
+ // Own properties of Grl-0.2.Grl.Caps
708
+
709
+ static name: string
710
+ static $gtype: GObject.GType<Caps>
711
+
712
+ // Constructors of Grl-0.2.Grl.Caps
713
+
714
+ constructor(config?: Caps.ConstructorProperties)
715
+ /**
716
+ * Creates a new caps object.
717
+ * @constructor
718
+ * @returns a new caps object.
719
+ */
720
+ constructor()
721
+ /**
722
+ * Creates a new caps object.
723
+ * @constructor
724
+ * @returns a new caps object.
725
+ */
726
+ static new(): Caps
727
+ _init(config?: Caps.ConstructorProperties): void
728
+ }
729
+
730
+ export module Config {
731
+
732
+ // Constructor properties interface
733
+
734
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
735
+ }
736
+
737
+ }
738
+
739
+ export interface Config {
740
+
741
+ // Own fields of Grl-0.2.Grl.Config
742
+
743
+ parent: GObject.Object
744
+ priv: ConfigPrivate
745
+ _grl_reserved: any[]
746
+
747
+ // Owm methods of Grl-0.2.Grl.Config
748
+
749
+ get_api_key(): string | null
750
+ get_api_key_blob(size: number): number
751
+ get_api_secret(): string | null
752
+ get_api_token(): string | null
753
+ get_api_token_secret(): string | null
754
+ /**
755
+ * Gets the value of `param` encoded as base64. If `size` is not %NULL, it puts
756
+ * there the size of the value.
757
+ * @param param a binary type parameter
758
+ * @param size place for size of value
759
+ * @returns @param value
760
+ */
761
+ get_binary(param: string | null, size: number | null): number
762
+ get_boolean(param: string | null): boolean
763
+ get_float(param: string | null): number
764
+ get_int(param: string | null): number
765
+ get_password(): string | null
766
+ get_plugin(): string | null
767
+ get_source(): string | null
768
+ get_string(param: string | null): string | null
769
+ get_username(): string | null
770
+ has_param(param: string | null): boolean
771
+ /**
772
+ * Set `param` `value`.
773
+ * @param param a parameter
774
+ * @param value value
775
+ */
776
+ set(param: string | null, value: any): void
777
+ /**
778
+ * Set the webservice API key in the configuration
779
+ * @param key the API key
780
+ */
781
+ set_api_key(key: string | null): void
782
+ /**
783
+ * Set the binary API key in the configuration
784
+ * @param blob the binary API key blob
785
+ * @param size the size of the blob
786
+ */
787
+ set_api_key_blob(blob: number, size: number): void
788
+ /**
789
+ * Set the webservice passphrase in the configuration
790
+ * @param secret the webservice passphrase
791
+ */
792
+ set_api_secret(secret: string | null): void
793
+ /**
794
+ * Set the webservice API token in the configuration
795
+ * @param token the API token
796
+ */
797
+ set_api_token(token: string | null): void
798
+ /**
799
+ * Set the webservice API token secret in the configuration
800
+ * (Needed by OAuth)
801
+ * @param secret the API token
802
+ */
803
+ set_api_token_secret(secret: string | null): void
804
+ /**
805
+ * Set `param` value.
806
+ * @param param a binary type parameter
807
+ * @param blob a base64 encoded binary value
808
+ * @param size size of `value`
809
+ */
810
+ set_binary(param: string | null, blob: number, size: number): void
811
+ /**
812
+ * Set `param` `value`.
813
+ * @param param a boolean type parameter
814
+ * @param value a value
815
+ */
816
+ set_boolean(param: string | null, value: boolean): void
817
+ /**
818
+ * Set `param` `value`.
819
+ * @param param a float type parameter
820
+ * @param value a value
821
+ */
822
+ set_float(param: string | null, value: number): void
823
+ /**
824
+ * Set `param` `value`.
825
+ * @param param an integer type parameter
826
+ * @param value a value
827
+ */
828
+ set_int(param: string | null, value: number): void
829
+ /**
830
+ * Set the password in the configuration
831
+ * @param password the password
832
+ */
833
+ set_password(password: string | null): void
834
+ /**
835
+ * Set the plugin key in the configuration
836
+ * @param plugin the plugin id
837
+ */
838
+ set_plugin(plugin: string | null): void
839
+ /**
840
+ * Set the source key in the configuration
841
+ * @param source the source id
842
+ */
843
+ set_source(source: string | null): void
844
+ /**
845
+ * Set `param` `value`.
846
+ * @param param a string type parameter
847
+ * @param value a value
848
+ */
849
+ set_string(param: string | null, value: string | null): void
850
+ /**
851
+ * Set the username in the configuration
852
+ * @param username the username
853
+ */
854
+ set_username(username: string | null): void
855
+
856
+ // Class property signals of Grl-0.2.Grl.Config
857
+
858
+ connect(sigName: string, callback: (...args: any[]) => void): number
859
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
860
+ emit(sigName: string, ...args: any[]): void
861
+ disconnect(id: number): void
862
+ }
863
+
864
+ export class Config extends GObject.Object {
865
+
866
+ // Own properties of Grl-0.2.Grl.Config
867
+
868
+ static name: string
869
+ static $gtype: GObject.GType<Config>
870
+
871
+ // Constructors of Grl-0.2.Grl.Config
872
+
873
+ constructor(config?: Config.ConstructorProperties)
874
+ /**
875
+ * Creates a new data config object that will be associated with a plugin
876
+ * (if `source` is NULL), or a specific source spawned from a plugin (if
877
+ * `source` is not NULL). The latter may be useful for plugins
878
+ * spawning various sources, each one needing a different configuration.
879
+ * @constructor
880
+ * @param plugin plugin id for this configuration
881
+ * @param source source id for this configuration
882
+ * @returns a newly-allocated data config. The data config associated with the plugin should not be freed until the plugin has been unloaded.
883
+ */
884
+ constructor(plugin: string | null, source: string | null)
885
+ /**
886
+ * Creates a new data config object that will be associated with a plugin
887
+ * (if `source` is NULL), or a specific source spawned from a plugin (if
888
+ * `source` is not NULL). The latter may be useful for plugins
889
+ * spawning various sources, each one needing a different configuration.
890
+ * @constructor
891
+ * @param plugin plugin id for this configuration
892
+ * @param source source id for this configuration
893
+ * @returns a newly-allocated data config. The data config associated with the plugin should not be freed until the plugin has been unloaded.
894
+ */
895
+ static new(plugin: string | null, source: string | null): Config
896
+ _init(config?: Config.ConstructorProperties): void
897
+ }
898
+
899
+ export module Data {
900
+
901
+ // Constructor properties interface
902
+
903
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
904
+ }
905
+
906
+ }
907
+
908
+ export interface Data {
909
+
910
+ // Own fields of Grl-0.2.Grl.Data
911
+
912
+ parent: GObject.Object
913
+ priv: DataPrivate
914
+ _grl_reserved: any[]
915
+
916
+ // Owm methods of Grl-0.2.Grl.Data
917
+
918
+ /**
919
+ * Appends a new binary value for `key` in `data`.
920
+ * @param key key to append
921
+ * @param buf the buffer containing the new value
922
+ * @param size size of buffer
923
+ */
924
+ add_binary(key: KeyID, buf: number, size: number): void
925
+ /**
926
+ * Appends a new boxed value for `key` in `data`.
927
+ * @param key key to append
928
+ * @param boxed the new value
929
+ */
930
+ add_boxed(key: KeyID, boxed: any | null): void
931
+ /**
932
+ * Appends a new float value for `key` in `data`.
933
+ * @param key key to append
934
+ * @param floatvalue the new value
935
+ */
936
+ add_float(key: KeyID, floatvalue: number): void
937
+ /**
938
+ * Appends a new int value for `key` in `data`.
939
+ * @param key key to append
940
+ * @param intvalue the new value
941
+ */
942
+ add_int(key: KeyID, intvalue: number): void
943
+ /**
944
+ * Appends a new int64 value for `key` in `data`.
945
+ * @param key key to append
946
+ * @param intvalue the new value
947
+ */
948
+ add_int64(key: KeyID, intvalue: number): void
949
+ /**
950
+ * Adds a new set of values into `data`.
951
+ *
952
+ * All keys in `prop` must be related among them.
953
+ *
954
+ * `data` will take the ownership of `relkeys,` so do not modify it.
955
+ * @param relkeys a set of related properties with their values
956
+ */
957
+ add_related_keys(relkeys: RelatedKeys): void
958
+ /**
959
+ * Appends a new string value for `key` in `data`.
960
+ * @param key key to append
961
+ * @param strvalue the new value
962
+ */
963
+ add_string(key: KeyID, strvalue: string | null): void
964
+ /**
965
+ * Makes a deep copy of `data` and all its contents.
966
+ * @returns a new #GrlData. Free it with #g_object_unref.
967
+ */
968
+ dup(): Data
969
+ /**
970
+ * Get the first value from `data` associated with `key`.
971
+ * @param key key to look up.
972
+ * @returns a #GValue. This value should not be modified nor freed by user.
973
+ */
974
+ get(key: KeyID): any
975
+ /**
976
+ * Returns the first binary value associated with `key` from `data`. If `key` has
977
+ * no first value, or value is not a gfloat, or `key` is not in data, then %NULL
978
+ * is returned.
979
+ * @param key key to use
980
+ * @returns buffer location associated with the @key, or %NULL in other case. If successful @size will be set the to the buffer size.
981
+ */
982
+ get_binary(key: KeyID): [ /* returnType */ number, /* size */ number ]
983
+ get_boolean(key: KeyID): boolean
984
+ /**
985
+ * Returns the first boxed value associated with `key` from `data`. If `key` has
986
+ * no first value, that value is not of a boxed type, or `key` is not in `data,`
987
+ * then %NULL is returned.
988
+ * @param key key to use
989
+ * @returns the boxed instance associated with @key if possible, or %NULL in other cases. The caller should not change nor free the value.
990
+ */
991
+ get_boxed(key: KeyID): any | null
992
+ /**
993
+ * Returns the first float value associated with `key` from `data`. If `key` has no
994
+ * first value, or value is not a gfloat, or `key` is not in data, then 0 is
995
+ * returned.
996
+ * @param key key to use
997
+ * @returns float value associated with @key, or 0 in other case.
998
+ */
999
+ get_float(key: KeyID): number
1000
+ /**
1001
+ * Returns the first int value associated with `key` from `data`. If `key` has no
1002
+ * first value, or value is not a gint, or `key` is not in data, then 0 is
1003
+ * returned.
1004
+ * @param key key to use
1005
+ * @returns int value associated with @key, or 0 in other case.
1006
+ */
1007
+ get_int(key: KeyID): number
1008
+ /**
1009
+ * Returns the first int64 value associated with `key` from `data`. If `key` has no
1010
+ * first value, or value is not a gint, or `key` is not in data, then 0 is
1011
+ * returned.
1012
+ * @param key key to use
1013
+ * @returns int value associated with @key, or 0 in other case.
1014
+ */
1015
+ get_int64(key: KeyID): number
1016
+ /**
1017
+ * Returns a list with keys contained in `data`.
1018
+ * @returns an array with the keys. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
1019
+ */
1020
+ get_keys(): KeyID[]
1021
+ /**
1022
+ * Returns a set containing the values for `key` and related keys at position
1023
+ * `index` from `data`.
1024
+ *
1025
+ * If user changes any of the values in the related keys, the changes will
1026
+ * become permanent.
1027
+ * @param key a metadata key
1028
+ * @param index element to retrieve, starting at 0
1029
+ * @returns a #GrlRelatedKeys. Do not free it.
1030
+ */
1031
+ get_related_keys(key: KeyID, index: number): RelatedKeys
1032
+ /**
1033
+ * Returns all non-%NULL values for `key` from `data`. This ignores related keys.
1034
+ * @param key a metadata key
1035
+ * @returns a #GList with values. Do not change or free the values. Free the list with #g_list_free.
1036
+ */
1037
+ get_single_values_for_key(key: KeyID): any[]
1038
+ /**
1039
+ * Returns all non-%NULL values for `key` from `data`. `key` must have been
1040
+ * registered as a string-type key. This ignores related keys.
1041
+ * @param key a metadata key
1042
+ * @returns a #GList with values. Do not change or free the strings. Free the list with #g_list_free.
1043
+ */
1044
+ get_single_values_for_key_string(key: KeyID): string[]
1045
+ /**
1046
+ * Returns the first string value associated with `key` from `data`. If `key` has
1047
+ * no first value, or value is not string, or `key` is not in `data,` then %NULL
1048
+ * is returned.
1049
+ * @param key key to use
1050
+ * @returns string associated with @key, or %NULL in other case. Caller should not change nor free the value.
1051
+ */
1052
+ get_string(key: KeyID): string | null
1053
+ /**
1054
+ * Checks if `key` is in `data`.
1055
+ * @param key key to search
1056
+ * @returns %TRUE if @key is in @data, %FALSE in other case.
1057
+ */
1058
+ has_key(key: KeyID): boolean
1059
+ /**
1060
+ * Returns how many values `key` or related keys have in `data:` if `key` has no
1061
+ * value, but a related key has, then it is counted as positive.
1062
+ *
1063
+ * As example, let's think in three related keys, K1, K2 and K3, and then thinks
1064
+ * we have added several values for those keys, as:
1065
+ *
1066
+ * (V10, V20, V30),, (V11, NULL, V31), (V12, NULL, V32)
1067
+ *
1068
+ * Therefore, when invoking grl_data_length (data, K2) it will return 3:
1069
+ * considering K2 and the related keys (K1 and K3), there are 3 values.
1070
+ * @param key a metadata key
1071
+ * @returns number of values
1072
+ */
1073
+ length(key: KeyID): number
1074
+ /**
1075
+ * Removes the first value for `key` from `data`. If there are other keys related
1076
+ * to `key` their values will also be removed from `data`.
1077
+ * @param key key to remove
1078
+ */
1079
+ remove(key: KeyID): void
1080
+ /**
1081
+ * Removes the value at position `index` for `key` from `data`. If there are other
1082
+ * keys related to `key,` their values at position `index` will also be removed
1083
+ * from `data`.
1084
+ * @param key a metadata key
1085
+ * @param index index of key to be removed, starting at 0
1086
+ */
1087
+ remove_nth(key: KeyID, index: number): void
1088
+ /**
1089
+ * Sets the first value associated with `key` in `data`. If key already has a
1090
+ * value old value is freed and the new one is set.
1091
+ *
1092
+ * Also, checks that `value` is compliant with `key` specification, modifying it
1093
+ * accordingly. For instance, if `key` requires a number between 0 and 10, but
1094
+ * `value` is outside this range, it will be adapted accordingly.
1095
+ * @param key key to change or add
1096
+ * @param value the new value
1097
+ */
1098
+ set(key: KeyID, value: any): void
1099
+ /**
1100
+ * Sets the first binary value associated with `key` in `data`. If `key` already
1101
+ * has a first value old value is replaced by the new one.
1102
+ * @param key key to change or add
1103
+ * @param buf buffer holding the data
1104
+ * @param size size of the buffer
1105
+ */
1106
+ set_binary(key: KeyID, buf: number, size: number): void
1107
+ /**
1108
+ * Sets the first boolean value associated with `key` in `data`. If `key` already
1109
+ * has a first value, old value is replaced by the new one.
1110
+ * @param key key to change or add
1111
+ * @param boolvalue the new value
1112
+ */
1113
+ set_boolean(key: KeyID, boolvalue: boolean): void
1114
+ /**
1115
+ * Sets the first boxed value associated with `key` in `data`. If `key` already
1116
+ * has a value, the old value is freed and the new one is set.
1117
+ * @param key key to change or add
1118
+ * @param boxed the new value
1119
+ */
1120
+ set_boxed(key: KeyID, boxed: any | null): void
1121
+ /**
1122
+ * Sets the first float value associated with `key` in `data`. If `key` already has
1123
+ * a first value old value is replaced by the new one.
1124
+ * @param key key to change or add
1125
+ * @param floatvalue the new value
1126
+ */
1127
+ set_float(key: KeyID, floatvalue: number): void
1128
+ /**
1129
+ * Sets the first int value associated with `key` in `data`. If `key` already has a
1130
+ * first value old value is replaced by the new one.
1131
+ * @param key key to change or add
1132
+ * @param intvalue the new value
1133
+ */
1134
+ set_int(key: KeyID, intvalue: number): void
1135
+ /**
1136
+ * Sets the first int64 value associated with `key` in `data`. If `key` already has a
1137
+ * first value old value is replaced by the new one.
1138
+ * @param key key to change or add
1139
+ * @param intvalue the new value
1140
+ */
1141
+ set_int64(key: KeyID, intvalue: number): void
1142
+ /**
1143
+ * Updates the values at position `index` in `data` with values in `relkeys`.
1144
+ *
1145
+ * `data` will take ownership of `relkeys,` so do not free it after invoking this
1146
+ * function.
1147
+ * @param relkeys a set of related keys
1148
+ * @param index position to be updated, starting at 0
1149
+ */
1150
+ set_related_keys(relkeys: RelatedKeys, index: number): void
1151
+ /**
1152
+ * Sets the first string value associated with `key` in `data`. If `key` already
1153
+ * has a value old value is freed and the new one is set.
1154
+ * @param key key to change or add
1155
+ * @param strvalue the new value
1156
+ */
1157
+ set_string(key: KeyID, strvalue: string | null): void
1158
+
1159
+ // Class property signals of Grl-0.2.Grl.Data
1160
+
1161
+ connect(sigName: string, callback: (...args: any[]) => void): number
1162
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1163
+ emit(sigName: string, ...args: any[]): void
1164
+ disconnect(id: number): void
1165
+ }
1166
+
1167
+ export class Data extends GObject.Object {
1168
+
1169
+ // Own properties of Grl-0.2.Grl.Data
1170
+
1171
+ static name: string
1172
+ static $gtype: GObject.GType<Data>
1173
+
1174
+ // Constructors of Grl-0.2.Grl.Data
1175
+
1176
+ constructor(config?: Data.ConstructorProperties)
1177
+ /**
1178
+ * Creates a new data object.
1179
+ * @constructor
1180
+ * @returns a new data object.
1181
+ */
1182
+ constructor()
1183
+ /**
1184
+ * Creates a new data object.
1185
+ * @constructor
1186
+ * @returns a new data object.
1187
+ */
1188
+ static new(): Data
1189
+ _init(config?: Data.ConstructorProperties): void
1190
+ }
1191
+
1192
+ export module Media {
1193
+
1194
+ // Constructor properties interface
1195
+
1196
+ export interface ConstructorProperties extends Data.ConstructorProperties {
1197
+ }
1198
+
1199
+ }
1200
+
1201
+ export interface Media {
1202
+
1203
+ // Own fields of Grl-0.2.Grl.Media
1204
+
1205
+ parent: Data & GObject.Object
1206
+
1207
+ // Owm methods of Grl-0.2.Grl.Media
1208
+
1209
+ /**
1210
+ * Adds a new author to `media`.
1211
+ * @param author an author for `media`
1212
+ */
1213
+ add_author(author: string | null): void
1214
+ /**
1215
+ * Adds a new external player to `media`.
1216
+ * @param player an external player for `media`
1217
+ */
1218
+ add_external_player(player: string | null): void
1219
+ /**
1220
+ * Adds a new external url to `media`.
1221
+ * @param url an external url for `media`
1222
+ */
1223
+ add_external_url(url: string | null): void
1224
+ /**
1225
+ * Adds the keyword describing the `media`.
1226
+ * @param keyword a keyword describing the media
1227
+ */
1228
+ add_keyword(keyword: string | null): void
1229
+ /**
1230
+ * Adds regional publication and certification information for `region`.
1231
+ * @param region the region's ISO-3166-1 code
1232
+ * @param publication_date the publication date
1233
+ * @param certificate the age certification
1234
+ */
1235
+ add_region_data(region: string | null, publication_date: GLib.DateTime, certificate: string | null): void
1236
+ /**
1237
+ * Adds a new thumbnail to `media`.
1238
+ * @param thumbnail a thumbnail for `media`
1239
+ */
1240
+ add_thumbnail(thumbnail: string | null): void
1241
+ /**
1242
+ * Adds a new thumbnail to `media`.
1243
+ * @param thumbnail a buffer containing the thumbnail for `media`
1244
+ * @param size size of buffer
1245
+ */
1246
+ add_thumbnail_binary(thumbnail: number, size: number): void
1247
+ /**
1248
+ * Adds a new media's URL with its mime-type.
1249
+ * @param url a media's URL
1250
+ * @param mime th `url` mime type
1251
+ */
1252
+ add_url_data(url: string | null, mime: string | null): void
1253
+ get_author(): string | null
1254
+ get_author_nth(index: number): string | null
1255
+ /**
1256
+ * Returns the media's first age certificate.
1257
+ * This should usually be the media's most relevant
1258
+ * age certificate. Use grl_media_get_region_data_nth() to
1259
+ * get other age certificates.
1260
+ * @returns the media's age certification
1261
+ */
1262
+ get_certificate(): string | null
1263
+ get_creation_date(): GLib.DateTime
1264
+ get_description(): string | null
1265
+ get_duration(): number
1266
+ get_external_url(): string | null
1267
+ get_external_url_nth(index: number): string | null
1268
+ get_favourite(): boolean
1269
+ get_id(): string | null
1270
+ get_keyword(): string | null
1271
+ get_keyword_nth(index: number): string | null
1272
+ get_last_played(): string | null
1273
+ get_last_position(): number
1274
+ get_license(): string | null
1275
+ get_mime(): string | null
1276
+ get_modification_date(): GLib.DateTime
1277
+ get_play_count(): number
1278
+ get_player(): string | null
1279
+ get_player_nth(index: number): string | null
1280
+ get_publication_date(): GLib.DateTime
1281
+ get_rating(): number
1282
+ get_region(): string | null
1283
+ /**
1284
+ * Returns the media's age certificate and publication date for the first region.
1285
+ * This should usually be the media's most relevant region.
1286
+ * Use grl_media_get_region_data_nth() to get the age certificate and
1287
+ * publication date for other regions.
1288
+ * @returns the ISO-3166-1 of the region where the media was published (owned by @media).
1289
+ */
1290
+ get_region_data(): [ /* returnType */ string | null, /* publication_date */ GLib.DateTime, /* certificate */ string | null ]
1291
+ /**
1292
+ * Returns the media's age certificate and publication date for one region.
1293
+ * Use grl_data_length() with GRL_METADATA_KEY_REGION to discover
1294
+ * how many regions are available. For instance:
1295
+ * <informalexample>
1296
+ * <programlisting role="C"><![CDATA[
1297
+ * guint count = grl_data_length (GRL_DATA (media), GRL_METADATA_KEY_REGION);
1298
+ * guint i;
1299
+ * for (i = 0; i < count; ++i) {
1300
+ * const GDateTime* publication_date = NULL;
1301
+ * const gchar* certificate = NULL;
1302
+ * const gchar* region =
1303
+ * grl_media_get_region_data_nth (media, i,
1304
+ * &publication_date, &certificate);
1305
+ * ...
1306
+ * }
1307
+ * ]]></programlisting>
1308
+ * </informalexample>
1309
+ * @param index element to retrieve
1310
+ * @returns the ISO-3166-1 of the region where the media was published (owned by @media).
1311
+ */
1312
+ get_region_data_nth(index: number): [ /* returnType */ string | null, /* publication_date */ GLib.DateTime, /* certificate */ string | null ]
1313
+ get_site(): string | null
1314
+ get_size(): number
1315
+ get_source(): string | null
1316
+ get_start_time(): number
1317
+ get_studio(): string | null
1318
+ get_thumbnail(): string | null
1319
+ get_thumbnail_binary(size: number): number
1320
+ get_thumbnail_binary_nth(size: number, index: number): number
1321
+ get_thumbnail_nth(index: number): string | null
1322
+ get_title(): string | null
1323
+ get_url(): string | null
1324
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1325
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1326
+ /**
1327
+ * Serializes a GrlMedia into a string. It does a basic serialization.
1328
+ *
1329
+ * See grl_media_serialize_extended() to get more serialization approaches.
1330
+ * @returns serialized media
1331
+ */
1332
+ serialize(): string | null
1333
+ /**
1334
+ * Set the media's author
1335
+ * @param author the media's author
1336
+ */
1337
+ set_author(author: string | null): void
1338
+ /**
1339
+ * Set the media's first age certification.
1340
+ * This should usually be the media's most relevant
1341
+ * age certificate. Use grl_media_set_region_data() to
1342
+ * set other age certificates.
1343
+ * @param certificate The age certificate of the media
1344
+ */
1345
+ set_certificate(certificate: string | null): void
1346
+ /**
1347
+ * Set the creation_date of the media
1348
+ * @param creation_date date when media was created
1349
+ */
1350
+ set_creation_date(creation_date: GLib.DateTime): void
1351
+ /**
1352
+ * Set the media's description
1353
+ * @param description the description
1354
+ */
1355
+ set_description(description: string | null): void
1356
+ /**
1357
+ * Set the media's duration
1358
+ * @param duration the duration in seconds
1359
+ */
1360
+ set_duration(duration: number): void
1361
+ /**
1362
+ * Set the location of a player for the media (usually a flash player)
1363
+ * @param player location of an external player for this media
1364
+ */
1365
+ set_external_player(player: string | null): void
1366
+ /**
1367
+ * Set an external location where users can play the media
1368
+ * @param url external location where this media can be played.
1369
+ */
1370
+ set_external_url(url: string | null): void
1371
+ /**
1372
+ * Set if the media is favourite or not
1373
+ * @param favourite whether the item is favourite or not
1374
+ */
1375
+ set_favourite(favourite: boolean): void
1376
+ /**
1377
+ * Set the media identifier
1378
+ * @param id the identifier of the media
1379
+ */
1380
+ set_id(id: string | null): void
1381
+ /**
1382
+ * Sets the keyword describing the `media`.
1383
+ * @param keyword a keyword describing the media
1384
+ */
1385
+ set_keyword(keyword: string | null): void
1386
+ /**
1387
+ * Set the media last played date
1388
+ * @param last_played date when the media was last played
1389
+ */
1390
+ set_last_played(last_played: string | null): void
1391
+ /**
1392
+ * Set the media last played position
1393
+ * @param last_position second at which the media playback was interrupted
1394
+ */
1395
+ set_last_position(last_position: number): void
1396
+ /**
1397
+ * Set the media license
1398
+ * @param license The license of the media
1399
+ */
1400
+ set_license(license: string | null): void
1401
+ /**
1402
+ * Set the media's mime-type
1403
+ * @param mime the mime type
1404
+ */
1405
+ set_mime(mime: string | null): void
1406
+ /**
1407
+ * Set the modification date of the media
1408
+ * @param modification_date date when the media was last modified
1409
+ */
1410
+ set_modification_date(modification_date: GLib.DateTime): void
1411
+ /**
1412
+ * Set the media play count
1413
+ * @param play_count the play count
1414
+ */
1415
+ set_play_count(play_count: number): void
1416
+ /**
1417
+ * Set the publication date of `media`.
1418
+ * @param date the date
1419
+ */
1420
+ set_publication_date(date: GLib.DateTime): void
1421
+ /**
1422
+ * This method receives a rating and its scale and normalizes it on a scale
1423
+ * from 0...5 to match the usual five-star rating.
1424
+ * @param rating a rating value
1425
+ * @param max maximum rating value
1426
+ */
1427
+ set_rating(rating: number, max: number): void
1428
+ /**
1429
+ * Sets the `region` where `media` was published.
1430
+ * @param region the region's ISO-3166-1 code
1431
+ */
1432
+ set_region(region: string | null): void
1433
+ /**
1434
+ * Sets regional publication and certification information for `region`.
1435
+ * @param region the region's ISO-3166-1 code
1436
+ * @param publication_date the publication date
1437
+ * @param certificate the age certification
1438
+ */
1439
+ set_region_data(region: string | null, publication_date: GLib.DateTime, certificate: string | null): void
1440
+ /**
1441
+ * Set the media's site. A site is a website about the media such as a
1442
+ * studio's promotional website for a movie.
1443
+ * @param site the site
1444
+ */
1445
+ set_site(site: string | null): void
1446
+ /**
1447
+ * Set the size of the media
1448
+ * @param size the size in bytes
1449
+ */
1450
+ set_size(size: number): void
1451
+ /**
1452
+ * Set the media's source
1453
+ * @param source the source
1454
+ */
1455
+ set_source(source: string | null): void
1456
+ /**
1457
+ * Set the media studio
1458
+ * @param studio The studio the media is from
1459
+ */
1460
+ set_studio(studio: string | null): void
1461
+ /**
1462
+ * Set the media's thumbnail URL
1463
+ * @param thumbnail the thumbnail URL
1464
+ */
1465
+ set_thumbnail(thumbnail: string | null): void
1466
+ /**
1467
+ * Set the media's binary thumbnail
1468
+ * @param thumbnail thumbnail buffer
1469
+ * @param size thumbnail buffer size
1470
+ */
1471
+ set_thumbnail_binary(thumbnail: number, size: number): void
1472
+ /**
1473
+ * Set the media's title
1474
+ * @param title the title
1475
+ */
1476
+ set_title(title: string | null): void
1477
+ /**
1478
+ * Set the media's URL
1479
+ * @param url the media's URL
1480
+ */
1481
+ set_url(url: string | null): void
1482
+ /**
1483
+ * Set the media's URL and its mime-type.
1484
+ * @param url the media's URL
1485
+ * @param mime the `url` mime type
1486
+ */
1487
+ set_url_data(url: string | null, mime: string | null): void
1488
+
1489
+ // Class property signals of Grl-0.2.Grl.Media
1490
+
1491
+ connect(sigName: string, callback: (...args: any[]) => void): number
1492
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1493
+ emit(sigName: string, ...args: any[]): void
1494
+ disconnect(id: number): void
1495
+ }
1496
+
1497
+ export class Media extends Data {
1498
+
1499
+ // Own properties of Grl-0.2.Grl.Media
1500
+
1501
+ static name: string
1502
+ static $gtype: GObject.GType<Media>
1503
+
1504
+ // Constructors of Grl-0.2.Grl.Media
1505
+
1506
+ constructor(config?: Media.ConstructorProperties)
1507
+ /**
1508
+ * Creates a new data media object.
1509
+ * @constructor
1510
+ * @returns a newly-allocated data media.
1511
+ */
1512
+ constructor()
1513
+ /**
1514
+ * Creates a new data media object.
1515
+ * @constructor
1516
+ * @returns a newly-allocated data media.
1517
+ */
1518
+ static new(): Media
1519
+
1520
+ // Overloads of new
1521
+
1522
+ /**
1523
+ * Creates a new data object.
1524
+ * @constructor
1525
+ * @returns a new data object.
1526
+ */
1527
+ static new(): Data
1528
+ _init(config?: Media.ConstructorProperties): void
1529
+ /**
1530
+ * Unserializes a GrlMedia.
1531
+ * @param serial a serialized media
1532
+ * @returns the GrlMedia from the serial
1533
+ */
1534
+ static unserialize(serial: string | null): Media
1535
+ }
1536
+
1537
+ export module MediaAudio {
1538
+
1539
+ // Constructor properties interface
1540
+
1541
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1542
+ }
1543
+
1544
+ }
1545
+
1546
+ export interface MediaAudio {
1547
+
1548
+ // Own fields of Grl-0.2.Grl.MediaAudio
1549
+
1550
+ parent: Media & Data & GObject.Object & GObject.Object
1551
+
1552
+ // Owm methods of Grl-0.2.Grl.MediaAudio
1553
+
1554
+ /**
1555
+ * Adds a new artist to `audio`.
1556
+ * @param artist an audio's artist
1557
+ */
1558
+ add_artist(artist: string | null): void
1559
+ /**
1560
+ * Adds a new genre to `audio`.
1561
+ * @param genre an audio's genre
1562
+ */
1563
+ add_genre(genre: string | null): void
1564
+ /**
1565
+ * Adds a new lyrics to `audio`.
1566
+ * @param lyrics an audio's lyrics
1567
+ */
1568
+ add_lyrics(lyrics: string | null): void
1569
+ /**
1570
+ * Adds a new MusicBrainz artist id to `audio`.
1571
+ * @param mb_artist_id a MusicBrainz artist identifier
1572
+ */
1573
+ add_mb_artist_id(mb_artist_id: string | null): void
1574
+ /**
1575
+ * Sets all the keys related with the URL of a media resource and adds it to
1576
+ * `audio` (useful for resources with more than one URL).
1577
+ * @param url an audio's url
1578
+ * @param mime the `url` mime-type
1579
+ * @param bitrate the `url` bitrate, or -1 to ignore
1580
+ */
1581
+ add_url_data(url: string | null, mime: string | null, bitrate: number): void
1582
+
1583
+ // Overloads of add_url_data
1584
+
1585
+ /**
1586
+ * Adds a new media's URL with its mime-type.
1587
+ * @param url a media's URL
1588
+ * @param mime th `url` mime type
1589
+ */
1590
+ add_url_data(url: string | null, mime: string | null): void
1591
+ get_album(): string | null
1592
+ get_artist(): string | null
1593
+ get_artist_nth(index: number): string | null
1594
+ get_bitrate(): number
1595
+ get_genre(): string | null
1596
+ get_genre_nth(index: number): string | null
1597
+ get_lyrics(): string | null
1598
+ get_lyrics_nth(index: number): string | null
1599
+ get_mb_album_id(): string | null
1600
+ get_mb_artist_id(): string | null
1601
+ get_mb_artist_id_nth(index: number): string | null
1602
+ get_mb_recording_id(): string | null
1603
+ get_mb_track_id(): string | null
1604
+ get_track_number(): number
1605
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null, /* bitrate */ number ]
1606
+
1607
+ // Overloads of get_url_data
1608
+
1609
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1610
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null, /* bitrate */ number ]
1611
+
1612
+ // Overloads of get_url_data_nth
1613
+
1614
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1615
+ /**
1616
+ * Set the album of the audio
1617
+ * @param album the audio's album
1618
+ */
1619
+ set_album(album: string | null): void
1620
+ /**
1621
+ * Set the artist of the audio
1622
+ * @param artist the audio's artist
1623
+ */
1624
+ set_artist(artist: string | null): void
1625
+ /**
1626
+ * Set the bitrate of the audio
1627
+ * @param bitrate the audio's bitrate
1628
+ */
1629
+ set_bitrate(bitrate: number): void
1630
+ /**
1631
+ * Set the genre of the audio
1632
+ * @param genre the audio's genre
1633
+ */
1634
+ set_genre(genre: string | null): void
1635
+ /**
1636
+ * Set the lyrics of the audio
1637
+ * @param lyrics the audio's lyrics
1638
+ */
1639
+ set_lyrics(lyrics: string | null): void
1640
+ /**
1641
+ * Set the MusicBrainz album identifier of the audio
1642
+ * @param mb_album_id the MusicBrainz album identifier
1643
+ */
1644
+ set_mb_album_id(mb_album_id: string | null): void
1645
+ /**
1646
+ * Set the MusicBrainz artist identifier of the audio
1647
+ * @param mb_artist_id the MusicBrainz artist identifier
1648
+ */
1649
+ set_mb_artist_id(mb_artist_id: string | null): void
1650
+ /**
1651
+ * Set the MusicBrainz recording identifier of the audio
1652
+ * @param mb_recording_id the MusicBrainz recording identifier
1653
+ */
1654
+ set_mb_recording_id(mb_recording_id: string | null): void
1655
+ /**
1656
+ * Set the MusicBrainz track identifier of the audio
1657
+ * @param mb_track_id the MusicBrainz track identifier
1658
+ */
1659
+ set_mb_track_id(mb_track_id: string | null): void
1660
+ /**
1661
+ * Set the track number of the audio
1662
+ * @param track_number the audio's track number
1663
+ */
1664
+ set_track_number(track_number: number): void
1665
+ /**
1666
+ * Sets all the keys related with the URL of an audio resource in one go.
1667
+ * @param url the audio's url
1668
+ * @param mime the `url` mime-type
1669
+ * @param bitrate the `url` bitrate, or -1 to ignore
1670
+ */
1671
+ set_url_data(url: string | null, mime: string | null, bitrate: number): void
1672
+
1673
+ // Overloads of set_url_data
1674
+
1675
+ /**
1676
+ * Set the media's URL and its mime-type.
1677
+ * @param url the media's URL
1678
+ * @param mime the `url` mime type
1679
+ */
1680
+ set_url_data(url: string | null, mime: string | null): void
1681
+
1682
+ // Class property signals of Grl-0.2.Grl.MediaAudio
1683
+
1684
+ connect(sigName: string, callback: (...args: any[]) => void): number
1685
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1686
+ emit(sigName: string, ...args: any[]): void
1687
+ disconnect(id: number): void
1688
+ }
1689
+
1690
+ export class MediaAudio extends Media {
1691
+
1692
+ // Own properties of Grl-0.2.Grl.MediaAudio
1693
+
1694
+ static name: string
1695
+ static $gtype: GObject.GType<MediaAudio>
1696
+
1697
+ // Constructors of Grl-0.2.Grl.MediaAudio
1698
+
1699
+ constructor(config?: MediaAudio.ConstructorProperties)
1700
+ /**
1701
+ * Creates a new data audio object.
1702
+ * @constructor
1703
+ * @returns a newly-allocated data audio.
1704
+ */
1705
+ constructor()
1706
+ /**
1707
+ * Creates a new data audio object.
1708
+ * @constructor
1709
+ * @returns a newly-allocated data audio.
1710
+ */
1711
+ static new(): MediaAudio
1712
+
1713
+ // Overloads of new
1714
+
1715
+ /**
1716
+ * Creates a new data media object.
1717
+ * @constructor
1718
+ * @returns a newly-allocated data media.
1719
+ */
1720
+ static new(): Media
1721
+ /**
1722
+ * Creates a new data object.
1723
+ * @constructor
1724
+ * @returns a new data object.
1725
+ */
1726
+ static new(): Data
1727
+ _init(config?: MediaAudio.ConstructorProperties): void
1728
+ }
1729
+
1730
+ export module MediaBox {
1731
+
1732
+ // Constructor properties interface
1733
+
1734
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1735
+ }
1736
+
1737
+ }
1738
+
1739
+ export interface MediaBox {
1740
+
1741
+ // Own fields of Grl-0.2.Grl.MediaBox
1742
+
1743
+ parent: Media & Data & GObject.Object & GObject.Object
1744
+
1745
+ // Owm methods of Grl-0.2.Grl.MediaBox
1746
+
1747
+ /**
1748
+ * Number of children of this box.
1749
+ * @returns number of children, or #GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN if unknown.
1750
+ */
1751
+ get_childcount(): number
1752
+ /**
1753
+ * Sets the number of children of this box. Use
1754
+ * #GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN if it is unknown.
1755
+ * @param childcount number of children
1756
+ */
1757
+ set_childcount(childcount: number): void
1758
+
1759
+ // Class property signals of Grl-0.2.Grl.MediaBox
1760
+
1761
+ connect(sigName: string, callback: (...args: any[]) => void): number
1762
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1763
+ emit(sigName: string, ...args: any[]): void
1764
+ disconnect(id: number): void
1765
+ }
1766
+
1767
+ export class MediaBox extends Media {
1768
+
1769
+ // Own properties of Grl-0.2.Grl.MediaBox
1770
+
1771
+ static name: string
1772
+ static $gtype: GObject.GType<MediaBox>
1773
+
1774
+ // Constructors of Grl-0.2.Grl.MediaBox
1775
+
1776
+ constructor(config?: MediaBox.ConstructorProperties)
1777
+ /**
1778
+ * Creates a new data box object.
1779
+ * @constructor
1780
+ * @returns a newly-allocated data box.
1781
+ */
1782
+ constructor()
1783
+ /**
1784
+ * Creates a new data box object.
1785
+ * @constructor
1786
+ * @returns a newly-allocated data box.
1787
+ */
1788
+ static new(): MediaBox
1789
+
1790
+ // Overloads of new
1791
+
1792
+ /**
1793
+ * Creates a new data media object.
1794
+ * @constructor
1795
+ * @returns a newly-allocated data media.
1796
+ */
1797
+ static new(): Media
1798
+ /**
1799
+ * Creates a new data object.
1800
+ * @constructor
1801
+ * @returns a new data object.
1802
+ */
1803
+ static new(): Data
1804
+ _init(config?: MediaBox.ConstructorProperties): void
1805
+ }
1806
+
1807
+ export module MediaImage {
1808
+
1809
+ // Constructor properties interface
1810
+
1811
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1812
+ }
1813
+
1814
+ }
1815
+
1816
+ export interface MediaImage {
1817
+
1818
+ // Own fields of Grl-0.2.Grl.MediaImage
1819
+
1820
+ parent: Media & Data & GObject.Object & GObject.Object
1821
+
1822
+ // Owm methods of Grl-0.2.Grl.MediaImage
1823
+
1824
+ /**
1825
+ * Sets all the keys related with the URL of a media resource and adds it to
1826
+ * `image` (useful for resources with more than one URL).
1827
+ * @param url a image's url
1828
+ * @param mime image mime-type
1829
+ * @param width image width, or -1 to ignore
1830
+ * @param height image height, or -1 to ignore
1831
+ */
1832
+ add_url_data(url: string | null, mime: string | null, width: number, height: number): void
1833
+
1834
+ // Overloads of add_url_data
1835
+
1836
+ /**
1837
+ * Adds a new media's URL with its mime-type.
1838
+ * @param url a media's URL
1839
+ * @param mime th `url` mime type
1840
+ */
1841
+ add_url_data(url: string | null, mime: string | null): void
1842
+ get_camera_model(): string | null
1843
+ get_exposure_time(): number
1844
+ get_flash_used(): string | null
1845
+ get_height(): number
1846
+ get_iso_speed(): number
1847
+ get_orientation(): number
1848
+ get_url_data(width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
1849
+
1850
+ // Overloads of get_url_data
1851
+
1852
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1853
+ get_url_data_nth(index: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
1854
+
1855
+ // Overloads of get_url_data_nth
1856
+
1857
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1858
+ get_width(): number
1859
+ set_camera_model(camera_model: string | null): void
1860
+ set_exposure_time(exposure_time: number): void
1861
+ set_flash_used(flash_used: string | null): void
1862
+ /**
1863
+ * Set the height of the image
1864
+ * @param height the image's height
1865
+ */
1866
+ set_height(height: number): void
1867
+ /**
1868
+ * Set the iso_speed of the image
1869
+ * @param iso_speed picture's iso speed
1870
+ */
1871
+ set_iso_speed(iso_speed: number): void
1872
+ /**
1873
+ * Set the orientation of the image
1874
+ * @param orientation degrees clockwise orientation of the picture
1875
+ */
1876
+ set_orientation(orientation: number): void
1877
+ /**
1878
+ * Set the size of the image
1879
+ * @param width the image's width
1880
+ * @param height the image's height
1881
+ */
1882
+ set_size(width: number, height: number): void
1883
+
1884
+ // Overloads of set_size
1885
+
1886
+ /**
1887
+ * Set the size of the media
1888
+ * @param size the size in bytes
1889
+ */
1890
+ set_size(size: number): void
1891
+ /**
1892
+ * Sets all the keys related with the URL of an image resource in one go.
1893
+ * @param url the image's url
1894
+ * @param mime image mime-type
1895
+ * @param width image width, or -1 to ignore
1896
+ * @param height image height, or -1 to ignore
1897
+ */
1898
+ set_url_data(url: string | null, mime: string | null, width: number, height: number): void
1899
+
1900
+ // Overloads of set_url_data
1901
+
1902
+ /**
1903
+ * Set the media's URL and its mime-type.
1904
+ * @param url the media's URL
1905
+ * @param mime the `url` mime type
1906
+ */
1907
+ set_url_data(url: string | null, mime: string | null): void
1908
+ /**
1909
+ * Set the width of the image
1910
+ * @param width the image's width
1911
+ */
1912
+ set_width(width: number): void
1913
+
1914
+ // Class property signals of Grl-0.2.Grl.MediaImage
1915
+
1916
+ connect(sigName: string, callback: (...args: any[]) => void): number
1917
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1918
+ emit(sigName: string, ...args: any[]): void
1919
+ disconnect(id: number): void
1920
+ }
1921
+
1922
+ export class MediaImage extends Media {
1923
+
1924
+ // Own properties of Grl-0.2.Grl.MediaImage
1925
+
1926
+ static name: string
1927
+ static $gtype: GObject.GType<MediaImage>
1928
+
1929
+ // Constructors of Grl-0.2.Grl.MediaImage
1930
+
1931
+ constructor(config?: MediaImage.ConstructorProperties)
1932
+ /**
1933
+ * Creates a new data image object.
1934
+ * @constructor
1935
+ * @returns a newly-allocated data image.
1936
+ */
1937
+ constructor()
1938
+ /**
1939
+ * Creates a new data image object.
1940
+ * @constructor
1941
+ * @returns a newly-allocated data image.
1942
+ */
1943
+ static new(): MediaImage
1944
+
1945
+ // Overloads of new
1946
+
1947
+ /**
1948
+ * Creates a new data media object.
1949
+ * @constructor
1950
+ * @returns a newly-allocated data media.
1951
+ */
1952
+ static new(): Media
1953
+ /**
1954
+ * Creates a new data object.
1955
+ * @constructor
1956
+ * @returns a new data object.
1957
+ */
1958
+ static new(): Data
1959
+ _init(config?: MediaImage.ConstructorProperties): void
1960
+ }
1961
+
1962
+ export module MediaVideo {
1963
+
1964
+ // Constructor properties interface
1965
+
1966
+ export interface ConstructorProperties extends Media.ConstructorProperties {
1967
+ }
1968
+
1969
+ }
1970
+
1971
+ export interface MediaVideo {
1972
+
1973
+ // Own fields of Grl-0.2.Grl.MediaVideo
1974
+
1975
+ parent: Media & Data & GObject.Object & GObject.Object
1976
+
1977
+ // Owm methods of Grl-0.2.Grl.MediaVideo
1978
+
1979
+ /**
1980
+ * Adds the director of the movie.
1981
+ * @param director director of the movie
1982
+ */
1983
+ add_director(director: string | null): void
1984
+ /**
1985
+ * Adds the actor performing in the movie.
1986
+ * @param performer an actor performing in the movie
1987
+ */
1988
+ add_performer(performer: string | null): void
1989
+ /**
1990
+ * Adds the producer of the movie.
1991
+ * @param producer producer of the movie
1992
+ */
1993
+ add_producer(producer: string | null): void
1994
+ /**
1995
+ * Sets all the keys related with the URL of a media resource and adds it to
1996
+ * `video` (useful for resources with more than one URL).
1997
+ * @param url a video's url
1998
+ * @param mime video mime-type
1999
+ * @param framerate video framerate, or -1 to ignore
2000
+ * @param width video width, or -1 to ignore
2001
+ * @param height video height, or -1 to ignore
2002
+ */
2003
+ add_url_data(url: string | null, mime: string | null, framerate: number, width: number, height: number): void
2004
+
2005
+ // Overloads of add_url_data
2006
+
2007
+ /**
2008
+ * Adds a new media's URL with its mime-type.
2009
+ * @param url a media's URL
2010
+ * @param mime th `url` mime type
2011
+ */
2012
+ add_url_data(url: string | null, mime: string | null): void
2013
+ get_director(): string | null
2014
+ get_director_nth(index: number): string | null
2015
+ get_episode(): number
2016
+ get_episode_title(): string | null
2017
+ get_framerate(): number
2018
+ get_height(): number
2019
+ get_original_title(): string | null
2020
+ get_performer(): string | null
2021
+ get_performer_nth(index: number): string | null
2022
+ get_producer(): string | null
2023
+ get_producer_nth(index: number): string | null
2024
+ get_season(): number
2025
+ get_show(): string | null
2026
+ get_url_data(framerate: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
2027
+
2028
+ // Overloads of get_url_data
2029
+
2030
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
2031
+ get_url_data_nth(index: number, framerate: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
2032
+
2033
+ // Overloads of get_url_data_nth
2034
+
2035
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
2036
+ get_width(): number
2037
+ /**
2038
+ * Sets the director of the movie.
2039
+ * @param director director of the movie
2040
+ */
2041
+ set_director(director: string | null): void
2042
+ /**
2043
+ * Sets the episode number of the video
2044
+ * @param episode the video's episode
2045
+ */
2046
+ set_episode(episode: number): void
2047
+ /**
2048
+ * Sets the title of an episode
2049
+ * @param episode_title the title of the episode
2050
+ */
2051
+ set_episode_title(episode_title: string | null): 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 original, untranslated title of the movie.
2064
+ * @param original_title original, untranslated title of the movie
2065
+ */
2066
+ set_original_title(original_title: string | null): void
2067
+ /**
2068
+ * Sets the actor performing in the movie.
2069
+ * @param performer an actor performing in the movie
2070
+ */
2071
+ set_performer(performer: string | null): void
2072
+ /**
2073
+ * Sets the producer of the movie.
2074
+ * @param producer producer of the movie
2075
+ */
2076
+ set_producer(producer: string | null): void
2077
+ /**
2078
+ * Sets the season number of the video
2079
+ * @param season the video's season
2080
+ */
2081
+ set_season(season: number): void
2082
+ /**
2083
+ * Sets the show title of the video
2084
+ * @param show the video's show name
2085
+ */
2086
+ set_show(show: string | null): void
2087
+ /**
2088
+ * Set the width and the height of the video
2089
+ * @param width the video's width
2090
+ * @param height the video's height
2091
+ */
2092
+ set_size(width: number, height: number): void
2093
+
2094
+ // Overloads of set_size
2095
+
2096
+ /**
2097
+ * Set the size of the media
2098
+ * @param size the size in bytes
2099
+ */
2100
+ set_size(size: number): void
2101
+ /**
2102
+ * Sets all the keys related with the URL of a video resource in one go.
2103
+ * @param url the video's url
2104
+ * @param mime video mime-type
2105
+ * @param framerate video framerate, or -1 to ignore
2106
+ * @param width video width, or -1 to ignore
2107
+ * @param height video height, or -1 to ignore
2108
+ */
2109
+ set_url_data(url: string | null, mime: string | null, framerate: number, width: number, height: number): void
2110
+
2111
+ // Overloads of set_url_data
2112
+
2113
+ /**
2114
+ * Set the media's URL and its mime-type.
2115
+ * @param url the media's URL
2116
+ * @param mime the `url` mime type
2117
+ */
2118
+ set_url_data(url: string | null, mime: string | null): void
2119
+ /**
2120
+ * Set the width of the video
2121
+ * @param width the video's width
2122
+ */
2123
+ set_width(width: number): void
2124
+
2125
+ // Class property signals of Grl-0.2.Grl.MediaVideo
2126
+
2127
+ connect(sigName: string, callback: (...args: any[]) => void): number
2128
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2129
+ emit(sigName: string, ...args: any[]): void
2130
+ disconnect(id: number): void
2131
+ }
2132
+
2133
+ export class MediaVideo extends Media {
2134
+
2135
+ // Own properties of Grl-0.2.Grl.MediaVideo
2136
+
2137
+ static name: string
2138
+ static $gtype: GObject.GType<MediaVideo>
2139
+
2140
+ // Constructors of Grl-0.2.Grl.MediaVideo
2141
+
2142
+ constructor(config?: MediaVideo.ConstructorProperties)
2143
+ /**
2144
+ * Creates a new data video object.
2145
+ * @constructor
2146
+ * @returns a newly-allocated data video.
2147
+ */
2148
+ constructor()
2149
+ /**
2150
+ * Creates a new data video object.
2151
+ * @constructor
2152
+ * @returns a newly-allocated data video.
2153
+ */
2154
+ static new(): MediaVideo
2155
+
2156
+ // Overloads of new
2157
+
2158
+ /**
2159
+ * Creates a new data media object.
2160
+ * @constructor
2161
+ * @returns a newly-allocated data media.
2162
+ */
2163
+ static new(): Media
2164
+ /**
2165
+ * Creates a new data object.
2166
+ * @constructor
2167
+ * @returns a new data object.
2168
+ */
2169
+ static new(): Data
2170
+ _init(config?: MediaVideo.ConstructorProperties): void
2171
+ }
2172
+
2173
+ export module OperationOptions {
2174
+
2175
+ // Constructor properties interface
2176
+
2177
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2178
+ }
2179
+
2180
+ }
2181
+
2182
+ export interface OperationOptions {
2183
+
2184
+ // Own fields of Grl-0.2.Grl.OperationOptions
2185
+
2186
+ parent: GObject.Object
2187
+
2188
+ // Owm methods of Grl-0.2.Grl.OperationOptions
2189
+
2190
+ copy(): OperationOptions
2191
+ /**
2192
+ * Get the count option, that is, the number of elements to retrieve in an
2193
+ * operation done with `options`.
2194
+ * @returns the value of the count option, or a default value if it is not set.
2195
+ */
2196
+ get_count(): number
2197
+ get_flags(): ResolutionFlags
2198
+ get_key_filter(key: KeyID): any
2199
+ get_key_filter_list(): KeyID[]
2200
+ /**
2201
+ * Stores the limits of the range in the filter for `key` in `min_value` and
2202
+ * `max_value`. If some of the values has no limit, it will set a %NULL.
2203
+ * @param key a #GrlKeyID
2204
+ */
2205
+ get_key_range_filter(key: KeyID): [ /* min_value */ any, /* max_value */ any ]
2206
+ get_key_range_filter_list(): KeyID[]
2207
+ get_resolution_flags(): ResolutionFlags
2208
+ /**
2209
+ * Get the skip option, that is, the number of elements to skip before
2210
+ * retrieving media items in an operation done with `options`.
2211
+ * @returns the value of the skip option, or a default value if it is not set.
2212
+ */
2213
+ get_skip(): number
2214
+ get_type_filter(): TypeFilter
2215
+ /**
2216
+ * This is an internal method that shouldn't be used outside of Grilo.
2217
+ * @param key an operation option key
2218
+ * @returns whether @key is set in @options.
2219
+ */
2220
+ key_is_set(key: string | null): boolean
2221
+ /**
2222
+ * Check whether `options` obey to `caps`.
2223
+ * Optionally provide the options that match (respectively don't match) `caps`
2224
+ * in `supported_options` (respectively `unsupported_options)`.
2225
+ * This would typically (but not necessarily) be used with a
2226
+ * #GrlOperationOptions instance that was created with %NULL caps.
2227
+ * @param caps capabilities against which we want to test `options`
2228
+ * @returns %TRUE if @options obey to @caps, %FALSE otherwise.
2229
+ */
2230
+ obey_caps(caps: Caps): [ /* returnType */ boolean, /* supported_options */ OperationOptions, /* unsupported_options */ OperationOptions ]
2231
+ /**
2232
+ * Set the count option for an operation. Will only succeed if `count` obey to
2233
+ * the inherent capabilities of `options`.
2234
+ * @param count number of elements to retrieve in an operation
2235
+ * @returns %TRUE if @count could be set, %FALSE otherwise.
2236
+ */
2237
+ set_count(count: number): boolean
2238
+ /**
2239
+ * Set the resolution flags for an operation. Will only succeed if `flags` obey
2240
+ * to the inherent capabilities of `options`.
2241
+ * @param flags the resolution flags to be set for an operation. See #GrlResolutionFlags for possible values.
2242
+ * @returns %TRUE if @flags could be set, %FALSE otherwise.
2243
+ */
2244
+ set_flags(flags: ResolutionFlags): boolean
2245
+ set_key_filters(filters: GLib.HashTable): boolean
2246
+ /**
2247
+ * Set filter as "`key` == `value"`.
2248
+ * @param key a #GrlKeyID
2249
+ * @param value a #GValue
2250
+ * @returns %TRUE on success
2251
+ */
2252
+ set_key_filter_value(key: KeyID, value: any): boolean
2253
+ /**
2254
+ * Set filter as "`min_value` <= `key` <= `max_value"`.
2255
+ *
2256
+ * If `min_value` is %NULL, then filter is "`key` <= `max_value"`.
2257
+ *
2258
+ * If `max_value` is %NULL, then filter is "`key` >= `min_value"`.
2259
+ * @param key a #GrlKeyID
2260
+ * @param min_value minimum value for range
2261
+ * @param max_value maximum value for range
2262
+ * @returns %TRUE on success
2263
+ */
2264
+ set_key_range_filter_value(key: KeyID, min_value: any | null, max_value: any | null): boolean
2265
+ /**
2266
+ * Set the resolution flags for an operation. Will only succeed if `flags` obey
2267
+ * to the inherent capabilities of `options`.
2268
+ * @param flags the resolution flags to be set for an operation. See #GrlResolutionFlags for possible values.
2269
+ * @returns %TRUE if @flags could be set, %FALSE otherwise.
2270
+ */
2271
+ set_resolution_flags(flags: ResolutionFlags): boolean
2272
+ /**
2273
+ * Set the skip option for an operation. Will only succeed if `skip` obeys to the
2274
+ * inherent capabilities of `options`.
2275
+ * @param skip number of elements to skip in an operation
2276
+ * @returns %TRUE if @skip could be set, %FALSE otherwise.
2277
+ */
2278
+ set_skip(skip: number): boolean
2279
+ /**
2280
+ * Set the type of media filter for an operation. Only those media elements that
2281
+ * match the `filter` will be returned. Will only succeed if `filter` obey to the
2282
+ * inherent capabilities of `options`.
2283
+ * @param filter the type of media to get
2284
+ * @returns %TRUE if @flags could be set, %FALSE otherwise
2285
+ */
2286
+ set_type_filter(filter: TypeFilter): boolean
2287
+
2288
+ // Class property signals of Grl-0.2.Grl.OperationOptions
2289
+
2290
+ connect(sigName: string, callback: (...args: any[]) => void): number
2291
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2292
+ emit(sigName: string, ...args: any[]): void
2293
+ disconnect(id: number): void
2294
+ }
2295
+
2296
+ export class OperationOptions extends GObject.Object {
2297
+
2298
+ // Own properties of Grl-0.2.Grl.OperationOptions
2299
+
2300
+ static name: string
2301
+ static $gtype: GObject.GType<OperationOptions>
2302
+
2303
+ // Constructors of Grl-0.2.Grl.OperationOptions
2304
+
2305
+ constructor(config?: OperationOptions.ConstructorProperties)
2306
+ /**
2307
+ * Creates a new GrlOperationOptions object.
2308
+ * @constructor
2309
+ * @param caps caps that options will have to match. If %NULL, all options will be accepted.
2310
+ * @returns a new GrlOperationOptions instance.
2311
+ */
2312
+ constructor(caps: Caps | null)
2313
+ /**
2314
+ * Creates a new GrlOperationOptions object.
2315
+ * @constructor
2316
+ * @param caps caps that options will have to match. If %NULL, all options will be accepted.
2317
+ * @returns a new GrlOperationOptions instance.
2318
+ */
2319
+ static new(caps: Caps | null): OperationOptions
2320
+ _init(config?: OperationOptions.ConstructorProperties): void
2321
+ }
2322
+
2323
+ export module Plugin {
2324
+
2325
+ // Constructor properties interface
2326
+
2327
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2328
+ }
2329
+
2330
+ }
2331
+
2332
+ export interface Plugin {
2333
+
2334
+ // Own properties of Grl-0.2.Grl.Plugin
2335
+
2336
+ /**
2337
+ * `TRUE` if plugin is loaded.
2338
+ */
2339
+ readonly loaded: boolean
2340
+
2341
+ // Own fields of Grl-0.2.Grl.Plugin
2342
+
2343
+ parent: GObject.Object
2344
+
2345
+ // Owm methods of Grl-0.2.Grl.Plugin
2346
+
2347
+ /**
2348
+ * Get the author of the plugin
2349
+ * @returns the author of the @plugin
2350
+ */
2351
+ get_author(): string | null
2352
+ /**
2353
+ * Get the description of the plugin
2354
+ * @returns the description of the @plugin
2355
+ */
2356
+ get_description(): string | null
2357
+ /**
2358
+ * Get the filename containing the plugin
2359
+ * @returns the filename containing @plugin
2360
+ */
2361
+ get_filename(): string | null
2362
+ /**
2363
+ * Get the id of the plugin
2364
+ * @returns the id of the @plugin
2365
+ */
2366
+ get_id(): string | null
2367
+ /**
2368
+ * Get the information of the `plugin` that is associated with the given key
2369
+ * @param key a key representing information about this plugin
2370
+ * @returns the information assigned to the given @key or NULL if there is no such information
2371
+ */
2372
+ get_info(key: string | null): string | null
2373
+ /**
2374
+ * Returns a list of keys that can be queried to retrieve information about the
2375
+ * plugin.
2376
+ * @returns a #GList of strings containing the keys. The content of the list is owned by the plugin and should not be modified or freed. Use g_list_free() when done using the list.
2377
+ */
2378
+ get_info_keys(): string[]
2379
+ /**
2380
+ * Get the license of the plugin
2381
+ * @returns the license of the @plugin
2382
+ */
2383
+ get_license(): string | null
2384
+ /**
2385
+ * Get the name of the plugin
2386
+ * @returns the name of the @plugin
2387
+ */
2388
+ get_name(): string | null
2389
+ /**
2390
+ * Get the site of the plugin
2391
+ * @returns the site of the @plugin
2392
+ */
2393
+ get_site(): string | null
2394
+ /**
2395
+ * Gets the sources belonging to `plugin`.
2396
+ * @returns a #GList of #GrlSource<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2397
+ */
2398
+ get_sources(): Source[]
2399
+ /**
2400
+ * Get the version of the plugin
2401
+ * @returns the version of the @plugin
2402
+ */
2403
+ get_version(): string | null
2404
+ /**
2405
+ * Load the plugin
2406
+ * @param configurations a list of configurations
2407
+ * @returns @TRUE if loaded was successful
2408
+ */
2409
+ load(configurations: Config[]): boolean
2410
+ register_keys(): void
2411
+ set_filename(filename: string | null): void
2412
+ set_id(id: string | null): void
2413
+ set_info(key: string | null, value: string | null): void
2414
+ set_load_func(load_function: any | null): void
2415
+ set_module(module: GModule.Module): void
2416
+ set_optional_info(info: GLib.HashTable): void
2417
+ set_register_keys_func(register_keys_function: any | null): void
2418
+ set_unload_func(unload_function: any | null): void
2419
+ unload(): void
2420
+
2421
+ // Class property signals of Grl-0.2.Grl.Plugin
2422
+
2423
+ connect(sigName: "notify::loaded", callback: (($obj: Plugin, pspec: GObject.ParamSpec) => void)): number
2424
+ connect_after(sigName: "notify::loaded", callback: (($obj: Plugin, pspec: GObject.ParamSpec) => void)): number
2425
+ emit(sigName: "notify::loaded", ...args: any[]): void
2426
+ connect(sigName: string, callback: (...args: any[]) => void): number
2427
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2428
+ emit(sigName: string, ...args: any[]): void
2429
+ disconnect(id: number): void
2430
+ }
2431
+
2432
+ export class Plugin extends GObject.Object {
2433
+
2434
+ // Own properties of Grl-0.2.Grl.Plugin
2435
+
2436
+ static name: string
2437
+ static $gtype: GObject.GType<Plugin>
2438
+
2439
+ // Constructors of Grl-0.2.Grl.Plugin
2440
+
2441
+ constructor(config?: Plugin.ConstructorProperties)
2442
+ _init(config?: Plugin.ConstructorProperties): void
2443
+ }
2444
+
2445
+ export module Registry {
2446
+
2447
+ // Signal callback interfaces
2448
+
2449
+ /**
2450
+ * Signal callback interface for `metadata-key-added`
2451
+ */
2452
+ export interface MetadataKeyAddedSignalCallback {
2453
+ ($obj: Registry, key: string | null): void
2454
+ }
2455
+
2456
+ /**
2457
+ * Signal callback interface for `source-added`
2458
+ */
2459
+ export interface SourceAddedSignalCallback {
2460
+ ($obj: Registry, source: Source): void
2461
+ }
2462
+
2463
+ /**
2464
+ * Signal callback interface for `source-removed`
2465
+ */
2466
+ export interface SourceRemovedSignalCallback {
2467
+ ($obj: Registry, source: Source): void
2468
+ }
2469
+
2470
+
2471
+ // Constructor properties interface
2472
+
2473
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2474
+ }
2475
+
2476
+ }
2477
+
2478
+ export interface Registry {
2479
+
2480
+ // Own fields of Grl-0.2.Grl.Registry
2481
+
2482
+ parent: GObject.Object
2483
+
2484
+ // Owm methods of Grl-0.2.Grl.Registry
2485
+
2486
+ /**
2487
+ * Add a configuration for a plugin/source.
2488
+ * @param config a configuration set
2489
+ * @returns %TRUE on success
2490
+ */
2491
+ add_config(config: Config): boolean
2492
+ /**
2493
+ * Load plugin configurations from a .ini-like config file.
2494
+ * @param config_file a key-value file containing the configuration
2495
+ * @returns %TRUE on success
2496
+ */
2497
+ add_config_from_file(config_file: string | null): boolean
2498
+ /**
2499
+ * Load plugin configurations from a .ini-like resource file.
2500
+ * @param resource_path a key-value file containing the configuration
2501
+ * @returns %TRUE on success
2502
+ */
2503
+ add_config_from_resource(resource_path: string | null): boolean
2504
+ /**
2505
+ * Set this path as part of default paths to load plugins.
2506
+ * @param path a path with plugins
2507
+ */
2508
+ add_directory(path: string | null): void
2509
+ /**
2510
+ * Returns a list with all registered keys in system.
2511
+ * @returns a #GList with all the available #GrlKeyID<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2512
+ */
2513
+ get_metadata_keys(): KeyID[]
2514
+ /**
2515
+ * This function will return all the available plugins in the `registry`.
2516
+ *
2517
+ * If `only_loaded` is %TRUE, the plugin list will contain only plugins that are
2518
+ * loaded.
2519
+ * @param only_loaded whether the returned list shall include only loaded plugins
2520
+ * @returns a #GList of available #GrlPlugin<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2521
+ */
2522
+ get_plugins(only_loaded: boolean): Plugin[]
2523
+ /**
2524
+ * This function will return all the available sources in the `registry`.
2525
+ *
2526
+ * If `ranked` is %TRUE, the source list will be ordered by rank.
2527
+ * @param ranked whether the returned list shall be returned ordered by rank
2528
+ * @returns a #GList of available #GrlSource<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2529
+ */
2530
+ get_sources(ranked: boolean): Source[]
2531
+ /**
2532
+ * Give an array of all the available sources in the `registry` capable of
2533
+ * perform the operations requested in `ops`.
2534
+ *
2535
+ * If `ranked` is %TRUE, the source list will be ordered by rank.
2536
+ * @param ops a bitwise mangle of the requested operations.
2537
+ * @param ranked whether the returned list shall be returned ordered by rank
2538
+ * @returns a #GList of available #GrlSource<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2539
+ */
2540
+ get_sources_by_operations(ops: SupportedOps, ranked: boolean): Source[]
2541
+ /**
2542
+ * Load all the modules available in the default directory path.
2543
+ *
2544
+ * The default directory path can be changed through the environment
2545
+ * variable %GRL_PLUGIN_PATH and it can contain several paths separated
2546
+ * by ":"
2547
+ * @returns %FALSE% is all the configured plugin paths are invalid, %TRUE% otherwise.
2548
+ */
2549
+ load_all_plugins(): boolean
2550
+ /**
2551
+ * Loads a module from shared object file stored in `path`
2552
+ * @param library_filename the path to the so file
2553
+ * @returns %TRUE if the module is loaded correctly
2554
+ */
2555
+ load_plugin(library_filename: string | null): boolean
2556
+ /**
2557
+ * Loads plugin identified by `plugin_id`.
2558
+ *
2559
+ * This requires the XML plugin information file to define a "module" key with
2560
+ * the name of the module that provides the plugin or the absolute path of the
2561
+ * actual module file.
2562
+ * @param plugin_id plugin identifier
2563
+ * @returns %TRUE if the plugin is loaded correctly
2564
+ */
2565
+ load_plugin_by_id(plugin_id: string | null): boolean
2566
+ /**
2567
+ * Loads a set of modules from directory in `path` which contains
2568
+ * a group shared object files.
2569
+ * @param path the path to the directory
2570
+ * @returns %TRUE if the directory is valid.
2571
+ */
2572
+ load_plugin_directory(path: string | null): boolean
2573
+ /**
2574
+ * Look up for the metadata key with name `key_name`.
2575
+ * @param key_name the key name
2576
+ * @returns The metadata key, or GRL_METADATA_KEY_INVALID if not found
2577
+ */
2578
+ lookup_metadata_key(key_name: string | null): KeyID
2579
+ /**
2580
+ * Returns `key` description.
2581
+ * @param key a metadata key
2582
+ * @returns metadata key description, or @NULL if not found
2583
+ */
2584
+ lookup_metadata_key_desc(key: KeyID): string | null
2585
+ /**
2586
+ * Returns `key` name.
2587
+ * @param key a metadata key
2588
+ * @returns metadata key name, or @NULL if not found
2589
+ */
2590
+ lookup_metadata_key_name(key: KeyID): string | null
2591
+ /**
2592
+ * Look up the list of keys that have a relation with `key`.
2593
+ *
2594
+ * `key` is included in that list.
2595
+ * @param key a metadata key
2596
+ * @returns a #GList of related keys, or @NULL if key is invalid.
2597
+ */
2598
+ lookup_metadata_key_relation(key: KeyID): KeyID[]
2599
+ /**
2600
+ * Returns `key` expected value type.
2601
+ * @param key a metadata key
2602
+ * @returns metadata key type, or @G_TYPE_INVALID if not found
2603
+ */
2604
+ lookup_metadata_key_type(key: KeyID): GObject.GType
2605
+ /**
2606
+ * This function will search and retrieve a plugin given its identifier.
2607
+ * @param plugin_id the id of a plugin
2608
+ * @returns The plugin found
2609
+ */
2610
+ lookup_plugin(plugin_id: string | null): Plugin
2611
+ /**
2612
+ * This function will search and retrieve a source given its identifier.
2613
+ * @param source_id the id of a source
2614
+ * @returns The source found.
2615
+ */
2616
+ lookup_source(source_id: string | null): Source
2617
+ /**
2618
+ * Validates `value` content complies with the key specification. That is, it has
2619
+ * the expected type, and value are within the range specified in key (for
2620
+ * integer values).
2621
+ * @param key a metadata key
2622
+ * @param value value to be validate
2623
+ * @returns %TRUE if complies
2624
+ */
2625
+ metadata_key_validate(key: KeyID, value: any): boolean
2626
+ /**
2627
+ * Registers a metadata key
2628
+ * @param param_spec The definition of the key to register
2629
+ * @returns The #GrlKeyID registered.
2630
+ */
2631
+ register_metadata_key(param_spec: GObject.ParamSpec): KeyID
2632
+ /**
2633
+ * Creates a relation between `key1` and `key2`, meaning that the values of both
2634
+ * keys are somehow related.
2635
+ *
2636
+ * One example of a relation would be the one between the URI of a media
2637
+ * resource and its mime-type: they are both tied together and one does not make
2638
+ * sense without the other.
2639
+ *
2640
+ * Relations between keys allow the framework to provide all the data that is
2641
+ * somehow related when any of the related keys are requested.
2642
+ * @param key1 key involved in relationship
2643
+ * @param key2 key involved in relationship
2644
+ */
2645
+ register_metadata_key_relation(key1: KeyID, key2: KeyID): void
2646
+ register_metadata_key_system(param_spec: GObject.ParamSpec, key: KeyID): KeyID
2647
+ /**
2648
+ * Register a `source` in the `registry` with the given `plugin` information
2649
+ * @param plugin the plugin which owns the source
2650
+ * @param source the source to register
2651
+ * @returns %TRUE if success, %FALSE% otherwise.
2652
+ */
2653
+ register_source(plugin: Plugin, source: Source): boolean
2654
+ restrict_plugins(plugins: string | null): void
2655
+ shutdown(): void
2656
+ /**
2657
+ * Unload from memory a module identified by `plugin_id`. This means call the
2658
+ * module's deinit function.
2659
+ * @param plugin_id the identifier of the plugin
2660
+ * @returns %TRUE% on success.
2661
+ */
2662
+ unload_plugin(plugin_id: string | null): boolean
2663
+ /**
2664
+ * Removes the `source` from the `registry` hash table
2665
+ * @param source the source to unregister
2666
+ * @returns %TRUE if success, %FALSE% otherwise.
2667
+ */
2668
+ unregister_source(source: Source): boolean
2669
+
2670
+ // Own signals of Grl-0.2.Grl.Registry
2671
+
2672
+ connect(sigName: "metadata-key-added", callback: Registry.MetadataKeyAddedSignalCallback): number
2673
+ connect_after(sigName: "metadata-key-added", callback: Registry.MetadataKeyAddedSignalCallback): number
2674
+ emit(sigName: "metadata-key-added", key: string | null, ...args: any[]): void
2675
+ connect(sigName: "source-added", callback: Registry.SourceAddedSignalCallback): number
2676
+ connect_after(sigName: "source-added", callback: Registry.SourceAddedSignalCallback): number
2677
+ emit(sigName: "source-added", source: Source, ...args: any[]): void
2678
+ connect(sigName: "source-removed", callback: Registry.SourceRemovedSignalCallback): number
2679
+ connect_after(sigName: "source-removed", callback: Registry.SourceRemovedSignalCallback): number
2680
+ emit(sigName: "source-removed", source: Source, ...args: any[]): void
2681
+
2682
+ // Class property signals of Grl-0.2.Grl.Registry
2683
+
2684
+ connect(sigName: string, callback: (...args: any[]) => void): number
2685
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2686
+ emit(sigName: string, ...args: any[]): void
2687
+ disconnect(id: number): void
2688
+ }
2689
+
2690
+ export class Registry extends GObject.Object {
2691
+
2692
+ // Own properties of Grl-0.2.Grl.Registry
2693
+
2694
+ static name: string
2695
+ static $gtype: GObject.GType<Registry>
2696
+
2697
+ // Constructors of Grl-0.2.Grl.Registry
2698
+
2699
+ constructor(config?: Registry.ConstructorProperties)
2700
+ _init(config?: Registry.ConstructorProperties): void
2701
+ /**
2702
+ * As the registry is designed to work as a singleton, this
2703
+ * method is in charge of creating the only instance or
2704
+ * returned it if it is already in memory.
2705
+ * @returns a new or an already created instance of the registry. It is NOT MT-safe
2706
+ */
2707
+ static get_default(): Registry
2708
+ }
2709
+
2710
+ export module RelatedKeys {
2711
+
2712
+ // Constructor properties interface
2713
+
2714
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2715
+ }
2716
+
2717
+ }
2718
+
2719
+ export interface RelatedKeys {
2720
+
2721
+ // Own fields of Grl-0.2.Grl.RelatedKeys
2722
+
2723
+ parent: GObject.Object
2724
+
2725
+ // Owm methods of Grl-0.2.Grl.RelatedKeys
2726
+
2727
+ /**
2728
+ * Makes a deep copy of `relkeys` and its contents.
2729
+ * @returns a new #GrlRelatedKeys. Free it with #g_object_unref.
2730
+ */
2731
+ dup(): RelatedKeys
2732
+ /**
2733
+ * Get the value associated with `key` from `relkeys`. If it does not contain any
2734
+ * value, %NULL will be returned.
2735
+ * @param key key to look up.
2736
+ * @returns a #GValue. This value should not be modified nor freed by user.
2737
+ */
2738
+ get(key: KeyID): any
2739
+ /**
2740
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2741
+ * or value is not a binary, or `key` is not in `relkeys,` then 0 is returned.
2742
+ * @param key key to use
2743
+ * @returns buffer location associated with @key, or %NULL in other case. If successful @size will be set to the buffer size.
2744
+ */
2745
+ get_binary(key: KeyID): [ /* returnType */ number, /* size */ number ]
2746
+ /**
2747
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2748
+ * or value is not a gboolean, or `key` is not in `relkeys,` then %FALSE is
2749
+ * returned.
2750
+ * @param key key to use
2751
+ * @returns float value associated with @key, or %FALSE in other case.
2752
+ */
2753
+ get_boolean(key: KeyID): boolean
2754
+ /**
2755
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2756
+ * the value is not of a boxed type, or `key` is not in `relkeys,` then %NULL is
2757
+ * returned.
2758
+ * @param key key to use
2759
+ * @returns the #GBoxed value associated with @key if possible, or %NULL in other case. The caller should not change nor free the value.
2760
+ */
2761
+ get_boxed(key: KeyID): any | null
2762
+ /**
2763
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2764
+ * or value is not a gfloat, or `key` is not in `relkeys,` then 0 is returned.
2765
+ * @param key key to use
2766
+ * @returns float value associated with @key, or 0 in other case.
2767
+ */
2768
+ get_float(key: KeyID): number
2769
+ /**
2770
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2771
+ * or value is not a gint, or `key` is not in `relkeys,` then 0 is returned.
2772
+ * @param key key to use
2773
+ * @returns int value associated with @key, or 0 in other case.
2774
+ */
2775
+ get_int(key: KeyID): number
2776
+ /**
2777
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2778
+ * or value is not a gint64, or `key` is not in `relkeys,` then 0 is returned.
2779
+ * @param key key to use
2780
+ * @returns int64 value associated with @key, or 0 in other case.
2781
+ */
2782
+ get_int64(key: KeyID): number
2783
+ /**
2784
+ * Returns a list with keys contained in `relkeys`.
2785
+ * @returns a list with the keys. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2786
+ */
2787
+ get_keys(): KeyID[]
2788
+ /**
2789
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2790
+ * or value is not string, or `key` is not in `relkeys,` then %NULL is returned.
2791
+ * @param key key to use
2792
+ * @returns string associated with @key, or %NULL in other case. Caller should not change nor free the value.
2793
+ */
2794
+ get_string(key: KeyID): string | null
2795
+ /**
2796
+ * Checks if `key` is in `relkeys`.
2797
+ * @param key key to search
2798
+ * @returns %TRUE if @key is in @relkeys, %FALSE in other case.
2799
+ */
2800
+ has_key(key: KeyID): boolean
2801
+ /**
2802
+ * Removes `key` from `relkeys` set.
2803
+ * @param key key to remove
2804
+ */
2805
+ remove(key: KeyID): void
2806
+ /**
2807
+ * Sets the value associated with `key` into `relkeys`. Old value is freed and
2808
+ * the new one is set.
2809
+ *
2810
+ * Also, checks that `value` is compliant with `key` specification, modifying it
2811
+ * accordingly. For instance, if `key` requires a number between 0 and 10, but
2812
+ * value is outside this range, it will be adapted accordingly.
2813
+ * @param key key to change or add
2814
+ * @param value the new value
2815
+ */
2816
+ set(key: KeyID, value: any): void
2817
+ /**
2818
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2819
+ * registered as a binary-type key. Old value is replaced by the new one.
2820
+ * @param key key to change or add
2821
+ * @param buf buffer holding the relkeys
2822
+ * @param size size of the buffer
2823
+ */
2824
+ set_binary(key: KeyID, buf: number, size: number): void
2825
+ /**
2826
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2827
+ * registered as a boolean-type key. Old value is replaced by the new one.
2828
+ * @param key key to change or add
2829
+ * @param booleanvalue the new value
2830
+ */
2831
+ set_boolean(key: KeyID, booleanvalue: boolean): void
2832
+ /**
2833
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2834
+ * registered as a boxed-type key. Old value is freed and the new one is set.
2835
+ * @param key key to change or add
2836
+ * @param boxed the new value
2837
+ */
2838
+ set_boxed(key: KeyID, boxed: any | null): void
2839
+ /**
2840
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2841
+ * registered as a float-type key. Old value is replaced by the new one.
2842
+ * @param key key to change or add
2843
+ * @param floatvalue the new value
2844
+ */
2845
+ set_float(key: KeyID, floatvalue: number): void
2846
+ /**
2847
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2848
+ * registered as an int-type key. Old value is replaced by the new one.
2849
+ * @param key key to change or add
2850
+ * @param intvalue the new value
2851
+ */
2852
+ set_int(key: KeyID, intvalue: number): void
2853
+ /**
2854
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2855
+ * registered as a int64-type key. Old value is replaced by the new one.
2856
+ * @param key key to change or add
2857
+ * @param intvalue the new value
2858
+ */
2859
+ set_int64(key: KeyID, intvalue: number): void
2860
+ /**
2861
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2862
+ * registered as a strying-type key. Old value is freed and the new one is set.
2863
+ * @param key key to change or add
2864
+ * @param strvalue the new value
2865
+ */
2866
+ set_string(key: KeyID, strvalue: string | null): void
2867
+
2868
+ // Class property signals of Grl-0.2.Grl.RelatedKeys
2869
+
2870
+ connect(sigName: string, callback: (...args: any[]) => void): number
2871
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2872
+ emit(sigName: string, ...args: any[]): void
2873
+ disconnect(id: number): void
2874
+ }
2875
+
2876
+ export class RelatedKeys extends GObject.Object {
2877
+
2878
+ // Own properties of Grl-0.2.Grl.RelatedKeys
2879
+
2880
+ static name: string
2881
+ static $gtype: GObject.GType<RelatedKeys>
2882
+
2883
+ // Constructors of Grl-0.2.Grl.RelatedKeys
2884
+
2885
+ constructor(config?: RelatedKeys.ConstructorProperties)
2886
+ /**
2887
+ * Creates a new #GrlRelatedKeys instance that can be used to store related
2888
+ * keys and their values.
2889
+ * @constructor
2890
+ * @returns a new object.
2891
+ */
2892
+ constructor()
2893
+ /**
2894
+ * Creates a new #GrlRelatedKeys instance that can be used to store related
2895
+ * keys and their values.
2896
+ * @constructor
2897
+ * @returns a new object.
2898
+ */
2899
+ static new(): RelatedKeys
2900
+ _init(config?: RelatedKeys.ConstructorProperties): void
2901
+ }
2902
+
2903
+ export module Source {
2904
+
2905
+ // Signal callback interfaces
2906
+
2907
+ /**
2908
+ * Signal callback interface for `content-changed`
2909
+ */
2910
+ export interface ContentChangedSignalCallback {
2911
+ ($obj: Source, changed_medias: Media[], change_type: SourceChangeType, location_unknown: boolean): void
2912
+ }
2913
+
2914
+
2915
+ // Constructor properties interface
2916
+
2917
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2918
+
2919
+ // Own constructor properties of Grl-0.2.Grl.Source
2920
+
2921
+ /**
2922
+ * Transparently split queries with count requests
2923
+ * bigger than a certain threshold into smaller queries.
2924
+ */
2925
+ auto_split_threshold?: number | null
2926
+ /**
2927
+ * Plugin the source belongs to
2928
+ */
2929
+ plugin?: Plugin | null
2930
+ /**
2931
+ * Source rank
2932
+ */
2933
+ rank?: number | null
2934
+ /**
2935
+ * A description of the source
2936
+ */
2937
+ source_desc?: string | null
2938
+ /**
2939
+ * #GIcon representing the source
2940
+ */
2941
+ source_icon?: Gio.Icon | null
2942
+ /**
2943
+ * The identifier of the source.
2944
+ */
2945
+ source_id?: string | null
2946
+ /**
2947
+ * The name of the source.
2948
+ */
2949
+ source_name?: string | null
2950
+ /**
2951
+ * A string array of tags relevant this source.
2952
+ *
2953
+ * The tags are arbitrary, and applications should just pass over the tags
2954
+ * it does not understand. Applications would usually use this to either
2955
+ * group sources together, or hide certain sources: a radio application
2956
+ * would filter for %GRL_MEDIA_TYPE_AUDIO in GrlSource::supported-media as
2957
+ * well as "radio" being listed in the tags.
2958
+ *
2959
+ * To avoid irrelevant content being listed in applications, sources
2960
+ * such as generic video sites should not be tagged as "cinema" or
2961
+ * "tv" as they contain a lot of content that's not either of those.
2962
+ *
2963
+ * This is a list of commonly used values:
2964
+ *
2965
+ * - "cinema", or "tv"
2966
+ * The content served is from cinema or TV sources. For example, a
2967
+ * source for movie trailers would select the former, a source for
2968
+ * streaming live TV would select the latter.
2969
+ *
2970
+ * - "radio"
2971
+ * The content served is from streaming radios.
2972
+ *
2973
+ * - "music"
2974
+ * The content served is music, for example, music stores such as
2975
+ * Jamendo or Magnatune.
2976
+ *
2977
+ * - "country:country-code"
2978
+ * The content is mostly relevant to users from a particular country,
2979
+ * such as a national broadcaster. For example, BBC content would be
2980
+ * tagged as "country:uk". Country codes should be an ISO-639-1 or
2981
+ * ISO-639-2 code.
2982
+ *
2983
+ * - "protocol:protocol-name"
2984
+ * The content browsing or searching uses a particular protocol, such
2985
+ * as DLNA/UPnP or DMAP/DAAP. This makes it easier to whitelist or
2986
+ * blacklist sources rather than matching the implementation specific
2987
+ * source ID. Examples are "protocol:dlna" and "protocol:dmap".
2988
+ *
2989
+ * - "localhost", or "localuser"
2990
+ * The content is served from the machine the application is running on,
2991
+ * or by an application the user is running. Applications might choose to
2992
+ * avoid showing the user's own data in their interfaces, or integrate it
2993
+ * in the user's local collection.
2994
+ *
2995
+ * "net:local", or "net:internet"
2996
+ * The source requires a connection to the local network, or a connection
2997
+ * to the Internet. Sources with those tags will be automatically hidden
2998
+ * from the application's reach when such networks aren't available, or
2999
+ * we're not connected to a network.
3000
+ *
3001
+ * "net:plaintext"
3002
+ * The source makes requests over plain text, non-encrypted, network channels,
3003
+ * such as using HTTP to do searches or lookups. Applications would usually
3004
+ * disable those by default, so that privacy is respected by default, and no
3005
+ * data is leaked unintentionally.
3006
+ */
3007
+ source_tags?: string[] | null
3008
+ /**
3009
+ * List of supported media types by this source.
3010
+ */
3011
+ supported_media?: MediaType | null
3012
+ }
3013
+
3014
+ }
3015
+
3016
+ export interface Source {
3017
+
3018
+ // Own properties of Grl-0.2.Grl.Source
3019
+
3020
+ /**
3021
+ * Transparently split queries with count requests
3022
+ * bigger than a certain threshold into smaller queries.
3023
+ */
3024
+ auto_split_threshold: number
3025
+ /**
3026
+ * Plugin the source belongs to
3027
+ */
3028
+ plugin: Plugin
3029
+ /**
3030
+ * Source rank
3031
+ */
3032
+ rank: number
3033
+ /**
3034
+ * A description of the source
3035
+ */
3036
+ source_desc: string | null
3037
+ /**
3038
+ * #GIcon representing the source
3039
+ */
3040
+ source_icon: Gio.Icon
3041
+ /**
3042
+ * The identifier of the source.
3043
+ */
3044
+ source_id: string | null
3045
+ /**
3046
+ * The name of the source.
3047
+ */
3048
+ source_name: string | null
3049
+ /**
3050
+ * A string array of tags relevant this source.
3051
+ *
3052
+ * The tags are arbitrary, and applications should just pass over the tags
3053
+ * it does not understand. Applications would usually use this to either
3054
+ * group sources together, or hide certain sources: a radio application
3055
+ * would filter for %GRL_MEDIA_TYPE_AUDIO in GrlSource::supported-media as
3056
+ * well as "radio" being listed in the tags.
3057
+ *
3058
+ * To avoid irrelevant content being listed in applications, sources
3059
+ * such as generic video sites should not be tagged as "cinema" or
3060
+ * "tv" as they contain a lot of content that's not either of those.
3061
+ *
3062
+ * This is a list of commonly used values:
3063
+ *
3064
+ * - "cinema", or "tv"
3065
+ * The content served is from cinema or TV sources. For example, a
3066
+ * source for movie trailers would select the former, a source for
3067
+ * streaming live TV would select the latter.
3068
+ *
3069
+ * - "radio"
3070
+ * The content served is from streaming radios.
3071
+ *
3072
+ * - "music"
3073
+ * The content served is music, for example, music stores such as
3074
+ * Jamendo or Magnatune.
3075
+ *
3076
+ * - "country:country-code"
3077
+ * The content is mostly relevant to users from a particular country,
3078
+ * such as a national broadcaster. For example, BBC content would be
3079
+ * tagged as "country:uk". Country codes should be an ISO-639-1 or
3080
+ * ISO-639-2 code.
3081
+ *
3082
+ * - "protocol:protocol-name"
3083
+ * The content browsing or searching uses a particular protocol, such
3084
+ * as DLNA/UPnP or DMAP/DAAP. This makes it easier to whitelist or
3085
+ * blacklist sources rather than matching the implementation specific
3086
+ * source ID. Examples are "protocol:dlna" and "protocol:dmap".
3087
+ *
3088
+ * - "localhost", or "localuser"
3089
+ * The content is served from the machine the application is running on,
3090
+ * or by an application the user is running. Applications might choose to
3091
+ * avoid showing the user's own data in their interfaces, or integrate it
3092
+ * in the user's local collection.
3093
+ *
3094
+ * "net:local", or "net:internet"
3095
+ * The source requires a connection to the local network, or a connection
3096
+ * to the Internet. Sources with those tags will be automatically hidden
3097
+ * from the application's reach when such networks aren't available, or
3098
+ * we're not connected to a network.
3099
+ *
3100
+ * "net:plaintext"
3101
+ * The source makes requests over plain text, non-encrypted, network channels,
3102
+ * such as using HTTP to do searches or lookups. Applications would usually
3103
+ * disable those by default, so that privacy is respected by default, and no
3104
+ * data is leaked unintentionally.
3105
+ */
3106
+ source_tags: string[]
3107
+ /**
3108
+ * List of supported media types by this source.
3109
+ */
3110
+ supported_media: MediaType
3111
+
3112
+ // Own fields of Grl-0.2.Grl.Source
3113
+
3114
+ parent: GObject.Object
3115
+
3116
+ // Owm methods of Grl-0.2.Grl.Source
3117
+
3118
+ /**
3119
+ * Browse from media elements through an available list.
3120
+ *
3121
+ * This method is asynchronous.
3122
+ * @param container a container of data transfer objects
3123
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3124
+ * @param options options wanted for that operation
3125
+ * @param callback the user defined callback
3126
+ * @returns the operation identifier
3127
+ */
3128
+ browse(container: Media | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
3129
+ /**
3130
+ * Browse media elements through an available
3131
+ * list.
3132
+ *
3133
+ * This method is synchronous.
3134
+ * @param container a container of data transfer objects
3135
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3136
+ * @param options options wanted for that operation
3137
+ * @returns a #GList with #GrlMedia elements. After use g_object_unref() every element and g_list_free() the list.
3138
+ */
3139
+ browse_sync(container: Media | null, keys: KeyID[], options: OperationOptions): Media[]
3140
+ /**
3141
+ * Gets how much elements the source is able to handle in a single request.
3142
+ *
3143
+ * See #grl_source_set_auto_split_threshold()
3144
+ * @returns the assigned threshold, or 0 if there is no threshold
3145
+ */
3146
+ get_auto_split_threshold(): number
3147
+ /**
3148
+ * Get the capabilities of `source` for `operation`.
3149
+ * @param operation a supported operation. Even though the type allows to specify several operations, only one should be provided here.
3150
+ * @returns The capabilities
3151
+ */
3152
+ get_caps(operation: SupportedOps): Caps
3153
+ get_description(): string | null
3154
+ get_icon(): Gio.Icon
3155
+ get_id(): string | null
3156
+ /**
3157
+ * Creates an instance of #GrlMedia representing the media resource
3158
+ * exposed at `uri`.
3159
+ *
3160
+ * It is recommended to call grl_source_test_media_from_uri() before invoking
3161
+ * this to check whether the target source can theoretically do the resolution.
3162
+ *
3163
+ * This method is asynchronous.
3164
+ * @param uri A URI that can be used to identify a media resource
3165
+ * @param keys A list of keys to resolve
3166
+ * @param options options wanted for that operation
3167
+ * @param callback the user defined callback
3168
+ * @returns the operation identifier
3169
+ */
3170
+ get_media_from_uri(uri: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResolveCb): number
3171
+ /**
3172
+ * Creates an instance of #GrlMedia representing the media resource
3173
+ * exposed at `uri`.
3174
+ *
3175
+ * It is recommended to call grl_source_test_media_from_uri() before
3176
+ * invoking this to check whether the target source can theoretically do the
3177
+ * resolution.
3178
+ *
3179
+ * This method is synchronous.
3180
+ * @param uri A URI that can be used to identify a media resource
3181
+ * @param keys a list of keys to resolve
3182
+ * @param options options wanted for that operation
3183
+ * @returns a filled #GrlMedia
3184
+ */
3185
+ get_media_from_uri_sync(uri: string | null, keys: KeyID[], options: OperationOptions): Media
3186
+ get_name(): string | null
3187
+ get_plugin(): Plugin
3188
+ /**
3189
+ * Gets the source rank
3190
+ * @returns rank value
3191
+ */
3192
+ get_rank(): number
3193
+ /**
3194
+ * Gets the supported type of medias `source` can deal with.
3195
+ * @returns a #GrlMediaType value
3196
+ */
3197
+ get_supported_media(): MediaType
3198
+ get_tags(): string[]
3199
+ /**
3200
+ * Checks whether `key_id` may be resolved with `source` for `media,` so that the
3201
+ * caller can avoid calling grl_source_resolve() if it can be known in
3202
+ * advance it will fail.
3203
+ *
3204
+ * If the resolution is known to be impossible because more keys are needed in
3205
+ * `media,` and `missing_keys` is not `NULL,` it is populated with the list of
3206
+ * GrlKeyID that would be needed.
3207
+ *
3208
+ * This function is synchronous and should not block.
3209
+ * @param media a media on which we want more metadata
3210
+ * @param key_id the key corresponding to a metadata we might want
3211
+ * @param missing_keys an optional originally empty list
3212
+ * @returns @TRUE if there's a possibility that @source resolves @key_id for @media, @FALSE otherwise.
3213
+ */
3214
+ may_resolve(media: Media, key_id: KeyID, missing_keys: KeyID[]): boolean
3215
+ /**
3216
+ * Emits "content-changed" signal to notify subscribers that a change ocurred
3217
+ * in `source`.
3218
+ *
3219
+ * See #grl_source_notify_change_list() function.
3220
+ *
3221
+ * <note>
3222
+ * <para>
3223
+ * This function is intended to be used only by plugins.
3224
+ * </para>
3225
+ * </note>
3226
+ * @param media the media which has changed, or `NULL` to use the root box.
3227
+ * @param change_type the type of change
3228
+ * @param location_unknown if change has happened in `media` or any descendant
3229
+ */
3230
+ notify_change(media: Media | null, change_type: SourceChangeType, location_unknown: boolean): void
3231
+ /**
3232
+ * Emits "content-changed" signal to notify subscribers that a change ocurred
3233
+ * in `source`.
3234
+ *
3235
+ * The function will take ownership of `changed` medias and it should not be
3236
+ * manipulated in any way by the caller after invoking this function. If that is
3237
+ * needed, the caller must ref the array in advance.
3238
+ *
3239
+ * See GrlSource::content-changed signal.
3240
+ *
3241
+ * <note>
3242
+ * <para>
3243
+ * This function is intended to be used only by plugins.
3244
+ * </para>
3245
+ * </note>
3246
+ * @param changed_medias the list of medias that have changed
3247
+ * @param change_type the type of change
3248
+ * @param location_unknown if change has happpened in `media` or any descendant
3249
+ */
3250
+ notify_change_list(changed_medias: Media[], change_type: SourceChangeType, location_unknown: boolean): void
3251
+ /**
3252
+ * Starts emitting ::content-changed signals when `source` discovers changes in
3253
+ * the content. This instructs `source` to setup the machinery needed to be aware
3254
+ * of changes in the content.
3255
+ * @returns @TRUE if initialization has succeed.
3256
+ */
3257
+ notify_change_start(): boolean
3258
+ /**
3259
+ * This will drop emission of ::content-changed signals from `source`. When this
3260
+ * is done `source` should stop the machinery required for it to track changes in
3261
+ * the content.
3262
+ * @returns @TRUE if stop has succeed.
3263
+ */
3264
+ notify_change_stop(): boolean
3265
+ /**
3266
+ * Execute a specialized query (specific for each provider) on a media
3267
+ * repository.
3268
+ *
3269
+ * It is different from grl_source_search() semantically, because the query
3270
+ * implies a carefully crafted string, rather than a simple string to search.
3271
+ *
3272
+ * This method is asynchronous.
3273
+ * @param query the query to process
3274
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3275
+ * @param options options wanted for that operation
3276
+ * @param callback the user defined callback
3277
+ * @returns the operation identifier
3278
+ */
3279
+ query(query: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
3280
+ /**
3281
+ * Execute a specialized query (specific for each provider) on a media
3282
+ * repository.
3283
+ *
3284
+ * This method is synchronous.
3285
+ * @param query the query to process
3286
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3287
+ * @param options options wanted for that operation
3288
+ * @returns a #GList with #GrlMedia elements. After use g_object_unref() every element and g_list_free() the list.
3289
+ */
3290
+ query_sync(query: string | null, keys: KeyID[], options: OperationOptions): Media[]
3291
+ /**
3292
+ * Remove a `media` from the `source` repository.
3293
+ *
3294
+ * This method is asynchronous.
3295
+ * @param media a data transfer object
3296
+ * @param callback the user defined callback
3297
+ */
3298
+ remove(media: Media, callback: SourceRemoveCb): void
3299
+ /**
3300
+ * Remove a `media` from the `source` repository.
3301
+ *
3302
+ * This method is synchronous.
3303
+ * @param media a data transfer object
3304
+ */
3305
+ remove_sync(media: Media): void
3306
+ /**
3307
+ * This method is intended to fetch the requested keys of metadata of
3308
+ * a given `media` to the media source.
3309
+ *
3310
+ * This method is asynchronous.
3311
+ * @param media a data transfer object
3312
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3313
+ * @param options options to pass to this operation
3314
+ * @param callback the user defined callback
3315
+ * @returns the operation identifie
3316
+ */
3317
+ resolve(media: Media | null, keys: KeyID[], options: OperationOptions, callback: SourceResolveCb): number
3318
+ /**
3319
+ * This method is intended to fetch the requested keys of metadata of
3320
+ * a given `media` to the media source.
3321
+ *
3322
+ * This method is synchronous.
3323
+ * @param media a data transfer object
3324
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3325
+ * @param options options to pass to this operation
3326
+ * @returns a filled #GrlMedia
3327
+ */
3328
+ resolve_sync(media: Media | null, keys: KeyID[], options: OperationOptions): Media
3329
+ /**
3330
+ * Search for the `text` string in a source for data identified with that string.
3331
+ *
3332
+ * If `text` is `NULL` then no text filter will be applied, and thus, no media
3333
+ * items from `source` will be filtered. If `source` does not support NULL-text
3334
+ * search operations it should notiy the client by setting
3335
+ * `GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED` in `callback'`s error parameter.
3336
+ *
3337
+ * This method is asynchronous.
3338
+ * @param text the text to search
3339
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3340
+ * @param options options wanted for that operation
3341
+ * @param callback the user defined callback
3342
+ * @returns the operation identifier
3343
+ */
3344
+ search(text: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
3345
+ /**
3346
+ * Search for the `text` string in a source for data identified with that string.
3347
+ *
3348
+ * If `text` is `NULL` then no text filter will be applied, and thus, no media
3349
+ * items from `source` will be filtered. If `source` does not support NULL-text
3350
+ * search operations it should notiy the client by setting
3351
+ * `GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED` in the error parameter.
3352
+ *
3353
+ * This method is synchronous.
3354
+ * @param text the text to search
3355
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3356
+ * @param options options wanted for that operation
3357
+ * @returns a #GList with #GrlMedia elements. After use g_object_unref() every element and g_list_free() the list.
3358
+ */
3359
+ search_sync(text: string | null, keys: KeyID[], options: OperationOptions): Media[]
3360
+ /**
3361
+ * Sets how much elements the source is able to handle in a single request.
3362
+ *
3363
+ * If user, during a search or browsing operation, asks for more elements than
3364
+ * the threshold, the request will be automatically splitted in chunks, so up to
3365
+ * `threshold` elements will be asked in each request.
3366
+ *
3367
+ * Source will act as if user were asking just a chunk, and user won't notice
3368
+ * that the request was chunked.
3369
+ *
3370
+ * <note>
3371
+ * <para>
3372
+ * This function is intended to be used only by plugins.
3373
+ * </para>
3374
+ * </note>
3375
+ * @param threshold the threshold to set
3376
+ */
3377
+ set_auto_split_threshold(threshold: number): void
3378
+ /**
3379
+ * Similar to grl_source_supported_keys(), but these keys
3380
+ * are marked as slow because of the amount of traffic/processing needed
3381
+ * to fetch them.
3382
+ * @returns a #GList with the keys
3383
+ */
3384
+ slow_keys(): KeyID[]
3385
+ /**
3386
+ * Store the `media` into the `parent` container
3387
+ *
3388
+ * This method is asynchronous.
3389
+ * @param parent a parent to store the data transfer objects
3390
+ * @param media a data transfer object
3391
+ * @param flags flags to configure specific behaviour of the operation
3392
+ * @param callback the user defined callback
3393
+ */
3394
+ store(parent: MediaBox | null, media: Media, flags: WriteFlags, callback: SourceStoreCb): void
3395
+ /**
3396
+ * Get the values for `keys` from `media` and store it permanently. After
3397
+ * calling this method, future queries that return this media object
3398
+ * shall return this new values for the selected keys.
3399
+ *
3400
+ * This function is asynchronous and uses the Glib's main loop.
3401
+ * @param media the #GrlMedia object that we want to operate on.
3402
+ * @param keys a list of #GrlKeyID whose values we want to change.
3403
+ * @param flags Flags to configure specific behaviors of the operation.
3404
+ * @param callback the callback to execute when the operation is finished.
3405
+ */
3406
+ store_metadata(media: Media, keys: KeyID[] | null, flags: WriteFlags, callback: SourceStoreCb): void
3407
+ /**
3408
+ * Update `keys` values from `media` in the `source`. After calling this method,
3409
+ * future queries that return this media object shall return this new value for
3410
+ * the selected key.
3411
+ *
3412
+ * This function is synchronous.
3413
+ * @param media the #GrlMedia object that we want to operate on
3414
+ * @param keys a list of #GrlKeyID whose values we want to change
3415
+ * @param flags Flags to configure specific behaviors of the operation.
3416
+ * @returns a #GList of keys that could not be updated, or @NULL
3417
+ */
3418
+ store_metadata_sync(media: Media, keys: KeyID[] | null, flags: WriteFlags): KeyID[]
3419
+ /**
3420
+ * Store the `media` into the `parent` container.
3421
+ *
3422
+ * This method is synchronous.
3423
+ * @param parent a #GrlMediaBox to store the data transfer objects
3424
+ * @param media a #GrlMedia data transfer object
3425
+ * @param flags flags to configure specific behaviour of the operation
3426
+ */
3427
+ store_sync(parent: MediaBox | null, media: Media, flags: WriteFlags): void
3428
+ /**
3429
+ * Get a list of #GrlKeyID, which describe a metadata types that this
3430
+ * source can fetch and store.
3431
+ * @returns a #GList with the keys
3432
+ */
3433
+ supported_keys(): KeyID[]
3434
+ /**
3435
+ * By default the derived objects of #GrlSource can only resolve.
3436
+ * @returns a bitwise mangle with the supported operations by the source
3437
+ */
3438
+ supported_operations(): number
3439
+ /**
3440
+ * Tests whether `source` can instantiate a #GrlMedia object representing
3441
+ * the media resource exposed at `uri`.
3442
+ * @param uri A URI that can be used to identify a media resource
3443
+ * @returns %TRUE if it can, %FALSE otherwise. This method is synchronous.
3444
+ */
3445
+ test_media_from_uri(uri: string | null): boolean
3446
+ /**
3447
+ * Similar to grl_source_supported_keys(), but these keys
3448
+ * are marked as writable, meaning the source allows the client
3449
+ * to provide new values for these keys that will be stored permanently.
3450
+ * @returns a #GList with the keys
3451
+ */
3452
+ writable_keys(): KeyID[]
3453
+
3454
+ // Own virtual methods of Grl-0.2.Grl.Source
3455
+
3456
+ vfunc_browse(bs: SourceBrowseSpec): void
3457
+ vfunc_cancel(operation_id: number): void
3458
+ /**
3459
+ * Get the capabilities of `source` for `operation`.
3460
+ * @virtual
3461
+ * @param operation a supported operation. Even though the type allows to specify several operations, only one should be provided here.
3462
+ * @returns The capabilities
3463
+ */
3464
+ vfunc_get_caps(operation: SupportedOps): Caps
3465
+ /**
3466
+ * Checks whether `key_id` may be resolved with `source` for `media,` so that the
3467
+ * caller can avoid calling grl_source_resolve() if it can be known in
3468
+ * advance it will fail.
3469
+ *
3470
+ * If the resolution is known to be impossible because more keys are needed in
3471
+ * `media,` and `missing_keys` is not `NULL,` it is populated with the list of
3472
+ * GrlKeyID that would be needed.
3473
+ *
3474
+ * This function is synchronous and should not block.
3475
+ * @virtual
3476
+ * @param media a media on which we want more metadata
3477
+ * @param key_id the key corresponding to a metadata we might want
3478
+ * @param missing_keys an optional originally empty list
3479
+ * @returns @TRUE if there's a possibility that @source resolves @key_id for @media, @FALSE otherwise.
3480
+ */
3481
+ vfunc_may_resolve(media: Media, key_id: KeyID, missing_keys: KeyID[]): boolean
3482
+ vfunc_media_from_uri(mfus: SourceMediaFromUriSpec): void
3483
+ /**
3484
+ * Starts emitting ::content-changed signals when `source` discovers changes in
3485
+ * the content. This instructs `source` to setup the machinery needed to be aware
3486
+ * of changes in the content.
3487
+ * @virtual
3488
+ * @returns @TRUE if initialization has succeed.
3489
+ */
3490
+ vfunc_notify_change_start(): boolean
3491
+ /**
3492
+ * This will drop emission of ::content-changed signals from `source`. When this
3493
+ * is done `source` should stop the machinery required for it to track changes in
3494
+ * the content.
3495
+ * @virtual
3496
+ * @returns @TRUE if stop has succeed.
3497
+ */
3498
+ vfunc_notify_change_stop(): boolean
3499
+ vfunc_query(qs: SourceQuerySpec): void
3500
+ vfunc_remove(rs: SourceRemoveSpec): void
3501
+ vfunc_resolve(ms: SourceResolveSpec): void
3502
+ vfunc_search(ss: SourceSearchSpec): void
3503
+ /**
3504
+ * Similar to grl_source_supported_keys(), but these keys
3505
+ * are marked as slow because of the amount of traffic/processing needed
3506
+ * to fetch them.
3507
+ * @virtual
3508
+ * @returns a #GList with the keys
3509
+ */
3510
+ vfunc_slow_keys(): KeyID[]
3511
+ vfunc_store(ss: SourceStoreSpec): void
3512
+ vfunc_store_metadata(sms: SourceStoreMetadataSpec): void
3513
+ /**
3514
+ * Get a list of #GrlKeyID, which describe a metadata types that this
3515
+ * source can fetch and store.
3516
+ * @virtual
3517
+ * @returns a #GList with the keys
3518
+ */
3519
+ vfunc_supported_keys(): KeyID[]
3520
+ vfunc_supported_operations(): SupportedOps
3521
+ /**
3522
+ * Tests whether `source` can instantiate a #GrlMedia object representing
3523
+ * the media resource exposed at `uri`.
3524
+ * @virtual
3525
+ * @param uri A URI that can be used to identify a media resource
3526
+ * @returns %TRUE if it can, %FALSE otherwise. This method is synchronous.
3527
+ */
3528
+ vfunc_test_media_from_uri(uri: string | null): boolean
3529
+ /**
3530
+ * Similar to grl_source_supported_keys(), but these keys
3531
+ * are marked as writable, meaning the source allows the client
3532
+ * to provide new values for these keys that will be stored permanently.
3533
+ * @virtual
3534
+ * @returns a #GList with the keys
3535
+ */
3536
+ vfunc_writable_keys(): KeyID[]
3537
+
3538
+ // Own signals of Grl-0.2.Grl.Source
3539
+
3540
+ connect(sigName: "content-changed", callback: Source.ContentChangedSignalCallback): number
3541
+ connect_after(sigName: "content-changed", callback: Source.ContentChangedSignalCallback): number
3542
+ emit(sigName: "content-changed", changed_medias: Media[], change_type: SourceChangeType, location_unknown: boolean, ...args: any[]): void
3543
+
3544
+ // Class property signals of Grl-0.2.Grl.Source
3545
+
3546
+ connect(sigName: "notify::auto-split-threshold", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3547
+ connect_after(sigName: "notify::auto-split-threshold", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3548
+ emit(sigName: "notify::auto-split-threshold", ...args: any[]): void
3549
+ connect(sigName: "notify::plugin", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3550
+ connect_after(sigName: "notify::plugin", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3551
+ emit(sigName: "notify::plugin", ...args: any[]): void
3552
+ connect(sigName: "notify::rank", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3553
+ connect_after(sigName: "notify::rank", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3554
+ emit(sigName: "notify::rank", ...args: any[]): void
3555
+ connect(sigName: "notify::source-desc", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3556
+ connect_after(sigName: "notify::source-desc", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3557
+ emit(sigName: "notify::source-desc", ...args: any[]): void
3558
+ connect(sigName: "notify::source-icon", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3559
+ connect_after(sigName: "notify::source-icon", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3560
+ emit(sigName: "notify::source-icon", ...args: any[]): void
3561
+ connect(sigName: "notify::source-id", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3562
+ connect_after(sigName: "notify::source-id", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3563
+ emit(sigName: "notify::source-id", ...args: any[]): void
3564
+ connect(sigName: "notify::source-name", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3565
+ connect_after(sigName: "notify::source-name", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3566
+ emit(sigName: "notify::source-name", ...args: any[]): void
3567
+ connect(sigName: "notify::source-tags", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3568
+ connect_after(sigName: "notify::source-tags", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3569
+ emit(sigName: "notify::source-tags", ...args: any[]): void
3570
+ connect(sigName: "notify::supported-media", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3571
+ connect_after(sigName: "notify::supported-media", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3572
+ emit(sigName: "notify::supported-media", ...args: any[]): void
3573
+ connect(sigName: string, callback: (...args: any[]) => void): number
3574
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
3575
+ emit(sigName: string, ...args: any[]): void
3576
+ disconnect(id: number): void
3577
+ }
3578
+
3579
+ export class Source extends GObject.Object {
3580
+
3581
+ // Own properties of Grl-0.2.Grl.Source
3582
+
3583
+ static name: string
3584
+ static $gtype: GObject.GType<Source>
3585
+
3586
+ // Constructors of Grl-0.2.Grl.Source
3587
+
3588
+ constructor(config?: Source.ConstructorProperties)
3589
+ _init(config?: Source.ConstructorProperties): void
3590
+ }
3591
+
3592
+ export interface CapsClass {
3593
+
3594
+ // Own fields of Grl-0.2.Grl.CapsClass
3595
+
3596
+ /**
3597
+ * the parent class structure
3598
+ * @field
3599
+ */
3600
+ parent: GObject.ObjectClass
3601
+ }
3602
+
3603
+ /**
3604
+ * Grilo Capabilities class.
3605
+ * @record
3606
+ */
3607
+ export abstract class CapsClass {
3608
+
3609
+ // Own properties of Grl-0.2.Grl.CapsClass
3610
+
3611
+ static name: string
3612
+ }
3613
+
3614
+ export interface CapsPrivate {
3615
+ }
3616
+
3617
+ export class CapsPrivate {
3618
+
3619
+ // Own properties of Grl-0.2.Grl.CapsPrivate
3620
+
3621
+ static name: string
3622
+ }
3623
+
3624
+ export interface ConfigClass {
3625
+
3626
+ // Own fields of Grl-0.2.Grl.ConfigClass
3627
+
3628
+ /**
3629
+ * the parent class structure
3630
+ * @field
3631
+ */
3632
+ parent_class: GObject.ObjectClass
3633
+ }
3634
+
3635
+ /**
3636
+ * Grilo Config Class
3637
+ * @record
3638
+ */
3639
+ export abstract class ConfigClass {
3640
+
3641
+ // Own properties of Grl-0.2.Grl.ConfigClass
3642
+
3643
+ static name: string
3644
+ }
3645
+
3646
+ export interface ConfigPrivate {
3647
+ }
3648
+
3649
+ export class ConfigPrivate {
3650
+
3651
+ // Own properties of Grl-0.2.Grl.ConfigPrivate
3652
+
3653
+ static name: string
3654
+ }
3655
+
3656
+ export interface DataClass {
3657
+
3658
+ // Own fields of Grl-0.2.Grl.DataClass
3659
+
3660
+ /**
3661
+ * the parent class structure
3662
+ * @field
3663
+ */
3664
+ parent_class: GObject.ObjectClass
3665
+ }
3666
+
3667
+ /**
3668
+ * Grilo Data class
3669
+ * @record
3670
+ */
3671
+ export abstract class DataClass {
3672
+
3673
+ // Own properties of Grl-0.2.Grl.DataClass
3674
+
3675
+ static name: string
3676
+ }
3677
+
3678
+ export interface DataPrivate {
3679
+ }
3680
+
3681
+ export class DataPrivate {
3682
+
3683
+ // Own properties of Grl-0.2.Grl.DataPrivate
3684
+
3685
+ static name: string
3686
+ }
3687
+
3688
+ export interface LogDomain {
3689
+
3690
+ // Owm methods of Grl-0.2.Grl.LogDomain
3691
+
3692
+ /**
3693
+ * Releases `domain`.
3694
+ */
3695
+ free(): void
3696
+ }
3697
+
3698
+ export class LogDomain {
3699
+
3700
+ // Own properties of Grl-0.2.Grl.LogDomain
3701
+
3702
+ static name: string
3703
+ }
3704
+
3705
+ export interface MediaAudioClass {
3706
+
3707
+ // Own fields of Grl-0.2.Grl.MediaAudioClass
3708
+
3709
+ /**
3710
+ * the parent class structure
3711
+ * @field
3712
+ */
3713
+ parent_class: MediaClass
3714
+ }
3715
+
3716
+ /**
3717
+ * Grilo Media audio Class
3718
+ * @record
3719
+ */
3720
+ export abstract class MediaAudioClass {
3721
+
3722
+ // Own properties of Grl-0.2.Grl.MediaAudioClass
3723
+
3724
+ static name: string
3725
+ }
3726
+
3727
+ export interface MediaBoxClass {
3728
+
3729
+ // Own fields of Grl-0.2.Grl.MediaBoxClass
3730
+
3731
+ /**
3732
+ * the parent class structure
3733
+ * @field
3734
+ */
3735
+ parent_class: MediaClass
3736
+ }
3737
+
3738
+ /**
3739
+ * Grilo Media box Class
3740
+ * @record
3741
+ */
3742
+ export abstract class MediaBoxClass {
3743
+
3744
+ // Own properties of Grl-0.2.Grl.MediaBoxClass
3745
+
3746
+ static name: string
3747
+ }
3748
+
3749
+ export interface MediaClass {
3750
+
3751
+ // Own fields of Grl-0.2.Grl.MediaClass
3752
+
3753
+ /**
3754
+ * the parent class structure
3755
+ * @field
3756
+ */
3757
+ parent_class: DataClass
3758
+ }
3759
+
3760
+ /**
3761
+ * Grilo Media Class
3762
+ * @record
3763
+ */
3764
+ export abstract class MediaClass {
3765
+
3766
+ // Own properties of Grl-0.2.Grl.MediaClass
3767
+
3768
+ static name: string
3769
+ }
3770
+
3771
+ export interface MediaImageClass {
3772
+
3773
+ // Own fields of Grl-0.2.Grl.MediaImageClass
3774
+
3775
+ /**
3776
+ * the parent class structure
3777
+ * @field
3778
+ */
3779
+ parent_class: MediaClass
3780
+ }
3781
+
3782
+ /**
3783
+ * Grilo Media image Class
3784
+ * @record
3785
+ */
3786
+ export abstract class MediaImageClass {
3787
+
3788
+ // Own properties of Grl-0.2.Grl.MediaImageClass
3789
+
3790
+ static name: string
3791
+ }
3792
+
3793
+ export interface MediaVideoClass {
3794
+
3795
+ // Own fields of Grl-0.2.Grl.MediaVideoClass
3796
+
3797
+ /**
3798
+ * the parent class structure
3799
+ * @field
3800
+ */
3801
+ parent_class: MediaClass
3802
+ }
3803
+
3804
+ /**
3805
+ * Grilo Media video Class
3806
+ * @record
3807
+ */
3808
+ export abstract class MediaVideoClass {
3809
+
3810
+ // Own properties of Grl-0.2.Grl.MediaVideoClass
3811
+
3812
+ static name: string
3813
+ }
3814
+
3815
+ export interface OperationOptionsClass {
3816
+
3817
+ // Own fields of Grl-0.2.Grl.OperationOptionsClass
3818
+
3819
+ /**
3820
+ * the parent class structure
3821
+ * @field
3822
+ */
3823
+ parent: GObject.ObjectClass
3824
+ }
3825
+
3826
+ /**
3827
+ * Grilo Operation Options class.
3828
+ * @record
3829
+ */
3830
+ export abstract class OperationOptionsClass {
3831
+
3832
+ // Own properties of Grl-0.2.Grl.OperationOptionsClass
3833
+
3834
+ static name: string
3835
+ }
3836
+
3837
+ export interface OperationOptionsPrivate {
3838
+ }
3839
+
3840
+ export class OperationOptionsPrivate {
3841
+
3842
+ // Own properties of Grl-0.2.Grl.OperationOptionsPrivate
3843
+
3844
+ static name: string
3845
+ }
3846
+
3847
+ export interface PluginClass {
3848
+
3849
+ // Own fields of Grl-0.2.Grl.PluginClass
3850
+
3851
+ /**
3852
+ * the parent class structure
3853
+ * @field
3854
+ */
3855
+ parent_class: GObject.ObjectClass
3856
+ }
3857
+
3858
+ export abstract class PluginClass {
3859
+
3860
+ // Own properties of Grl-0.2.Grl.PluginClass
3861
+
3862
+ static name: string
3863
+ }
3864
+
3865
+ export interface PluginDescriptor {
3866
+
3867
+ // Own fields of Grl-0.2.Grl.PluginDescriptor
3868
+
3869
+ /**
3870
+ * the module identifier
3871
+ * @field
3872
+ */
3873
+ plugin_id: string | null
3874
+ plugin_deinit: (plugin: Plugin) => void
3875
+ /**
3876
+ * the #GModule instance.
3877
+ * @field
3878
+ */
3879
+ module: GModule.Module
3880
+ plugin_register_keys: (registry: Registry, plugin: Plugin) => void
3881
+ }
3882
+
3883
+ /**
3884
+ * This structure is used for the module loader
3885
+ * @record
3886
+ */
3887
+ export class PluginDescriptor {
3888
+
3889
+ // Own properties of Grl-0.2.Grl.PluginDescriptor
3890
+
3891
+ static name: string
3892
+ }
3893
+
3894
+ export interface PluginPrivate {
3895
+ }
3896
+
3897
+ export class PluginPrivate {
3898
+
3899
+ // Own properties of Grl-0.2.Grl.PluginPrivate
3900
+
3901
+ static name: string
3902
+ }
3903
+
3904
+ export interface RangeValue {
3905
+
3906
+ // Own fields of Grl-0.2.Grl.RangeValue
3907
+
3908
+ min: any
3909
+ max: any
3910
+
3911
+ // Owm methods of Grl-0.2.Grl.RangeValue
3912
+
3913
+ dup(): RangeValue
3914
+ free(): void
3915
+ }
3916
+
3917
+ export class RangeValue {
3918
+
3919
+ // Own properties of Grl-0.2.Grl.RangeValue
3920
+
3921
+ static name: string
3922
+
3923
+ // Constructors of Grl-0.2.Grl.RangeValue
3924
+
3925
+ constructor(min: any, max: any)
3926
+ static new(min: any, max: any): RangeValue
3927
+ static hashtable_insert(hash_table: GLib.HashTable, key: any | null, min: any, max: any): void
3928
+ static hashtable_new(): GLib.HashTable
3929
+ }
3930
+
3931
+ export interface RegistryClass {
3932
+
3933
+ // Own fields of Grl-0.2.Grl.RegistryClass
3934
+
3935
+ /**
3936
+ * the parent class structure
3937
+ * @field
3938
+ */
3939
+ parent_class: GObject.ObjectClass
3940
+ }
3941
+
3942
+ /**
3943
+ * Grilo Registry class. Dynamic loader of plugins.
3944
+ * @record
3945
+ */
3946
+ export abstract class RegistryClass {
3947
+
3948
+ // Own properties of Grl-0.2.Grl.RegistryClass
3949
+
3950
+ static name: string
3951
+ }
3952
+
3953
+ export interface RegistryPrivate {
3954
+ }
3955
+
3956
+ export class RegistryPrivate {
3957
+
3958
+ // Own properties of Grl-0.2.Grl.RegistryPrivate
3959
+
3960
+ static name: string
3961
+ }
3962
+
3963
+ export interface RelatedKeysClass {
3964
+
3965
+ // Own fields of Grl-0.2.Grl.RelatedKeysClass
3966
+
3967
+ /**
3968
+ * the parent class structure
3969
+ * @field
3970
+ */
3971
+ parent_class: GObject.ObjectClass
3972
+ }
3973
+
3974
+ /**
3975
+ * Grilo Data Multivalued class
3976
+ * @record
3977
+ */
3978
+ export abstract class RelatedKeysClass {
3979
+
3980
+ // Own properties of Grl-0.2.Grl.RelatedKeysClass
3981
+
3982
+ static name: string
3983
+ }
3984
+
3985
+ export interface RelatedKeysPrivate {
3986
+ }
3987
+
3988
+ export class RelatedKeysPrivate {
3989
+
3990
+ // Own properties of Grl-0.2.Grl.RelatedKeysPrivate
3991
+
3992
+ static name: string
3993
+ }
3994
+
3995
+ export interface SourceBrowseSpec {
3996
+
3997
+ // Own fields of Grl-0.2.Grl.SourceBrowseSpec
3998
+
3999
+ /**
4000
+ * a source
4001
+ * @field
4002
+ */
4003
+ source: Source
4004
+ /**
4005
+ * operation identifier
4006
+ * @field
4007
+ */
4008
+ operation_id: number
4009
+ /**
4010
+ * a container of data transfer objects
4011
+ * @field
4012
+ */
4013
+ container: Media
4014
+ /**
4015
+ * the #GList of #GrlKeyID<!-- -->s to request
4016
+ * @field
4017
+ */
4018
+ keys: any[]
4019
+ /**
4020
+ * options wanted for that operation
4021
+ * @field
4022
+ */
4023
+ options: OperationOptions
4024
+ /**
4025
+ * the user defined callback
4026
+ * @field
4027
+ */
4028
+ callback: SourceResultCb
4029
+ /**
4030
+ * the user data to pass in the callback
4031
+ * @field
4032
+ */
4033
+ user_data: any
4034
+ }
4035
+
4036
+ /**
4037
+ * Data transport structure used internally by the plugins which support
4038
+ * browse vmethod.
4039
+ * @record
4040
+ */
4041
+ export class SourceBrowseSpec {
4042
+
4043
+ // Own properties of Grl-0.2.Grl.SourceBrowseSpec
4044
+
4045
+ static name: string
4046
+ }
4047
+
4048
+ export interface SourceClass {
4049
+
4050
+ // Own fields of Grl-0.2.Grl.SourceClass
4051
+
4052
+ /**
4053
+ * the parent class structure
4054
+ * @field
4055
+ */
4056
+ parent_class: GObject.ObjectClass
4057
+ supported_operations: (source: Source) => SupportedOps
4058
+ supported_keys: (source: Source) => KeyID[]
4059
+ slow_keys: (source: Source) => KeyID[]
4060
+ writable_keys: (source: Source) => KeyID[]
4061
+ get_caps: (source: Source, operation: SupportedOps) => Caps
4062
+ resolve: (source: Source, ms: SourceResolveSpec) => void
4063
+ may_resolve: (source: Source, media: Media, key_id: KeyID, missing_keys: KeyID[]) => boolean
4064
+ test_media_from_uri: (source: Source, uri: string | null) => boolean
4065
+ media_from_uri: (source: Source, mfus: SourceMediaFromUriSpec) => void
4066
+ browse: (source: Source, bs: SourceBrowseSpec) => void
4067
+ search: (source: Source, ss: SourceSearchSpec) => void
4068
+ query: (source: Source, qs: SourceQuerySpec) => void
4069
+ remove: (source: Source, rs: SourceRemoveSpec) => void
4070
+ store: (source: Source, ss: SourceStoreSpec) => void
4071
+ store_metadata: (source: Source, sms: SourceStoreMetadataSpec) => void
4072
+ cancel: (source: Source, operation_id: number) => void
4073
+ notify_change_start: (source: Source) => boolean
4074
+ notify_change_stop: (source: Source) => boolean
4075
+ }
4076
+
4077
+ /**
4078
+ * Grilo Source class. Override the vmethods to implement the
4079
+ * element functionality.
4080
+ * @record
4081
+ */
4082
+ export abstract class SourceClass {
4083
+
4084
+ // Own properties of Grl-0.2.Grl.SourceClass
4085
+
4086
+ static name: string
4087
+ }
4088
+
4089
+ export interface SourceMediaFromUriSpec {
4090
+
4091
+ // Own fields of Grl-0.2.Grl.SourceMediaFromUriSpec
4092
+
4093
+ /**
4094
+ * a source
4095
+ * @field
4096
+ */
4097
+ source: Source
4098
+ /**
4099
+ * operation identifier
4100
+ * @field
4101
+ */
4102
+ operation_id: number
4103
+ /**
4104
+ * A URI that can be used to identify a media resource
4105
+ * @field
4106
+ */
4107
+ uri: string | null
4108
+ /**
4109
+ * Metadata keys to resolve
4110
+ * @field
4111
+ */
4112
+ keys: any[]
4113
+ /**
4114
+ * options wanted for that operation
4115
+ * @field
4116
+ */
4117
+ options: OperationOptions
4118
+ /**
4119
+ * the user defined callback
4120
+ * @field
4121
+ */
4122
+ callback: SourceResolveCb
4123
+ /**
4124
+ * the user data to pass in the callback
4125
+ * @field
4126
+ */
4127
+ user_data: any
4128
+ }
4129
+
4130
+ /**
4131
+ * Data transport structure used internally by the plugins which support
4132
+ * media_from_uri vmethod.
4133
+ * @record
4134
+ */
4135
+ export class SourceMediaFromUriSpec {
4136
+
4137
+ // Own properties of Grl-0.2.Grl.SourceMediaFromUriSpec
4138
+
4139
+ static name: string
4140
+ }
4141
+
4142
+ export interface SourcePrivate {
4143
+ }
4144
+
4145
+ export class SourcePrivate {
4146
+
4147
+ // Own properties of Grl-0.2.Grl.SourcePrivate
4148
+
4149
+ static name: string
4150
+ }
4151
+
4152
+ export interface SourceQuerySpec {
4153
+
4154
+ // Own fields of Grl-0.2.Grl.SourceQuerySpec
4155
+
4156
+ /**
4157
+ * a source
4158
+ * @field
4159
+ */
4160
+ source: Source
4161
+ /**
4162
+ * operation identifier
4163
+ * @field
4164
+ */
4165
+ operation_id: number
4166
+ /**
4167
+ * the query to process
4168
+ * @field
4169
+ */
4170
+ query: string | null
4171
+ /**
4172
+ * the #GList of #GrlKeyID<!-- -->s to request
4173
+ * @field
4174
+ */
4175
+ keys: any[]
4176
+ /**
4177
+ * options wanted for that operation
4178
+ * @field
4179
+ */
4180
+ options: OperationOptions
4181
+ /**
4182
+ * the user defined callback
4183
+ * @field
4184
+ */
4185
+ callback: SourceResultCb
4186
+ /**
4187
+ * the user data to pass in the callback
4188
+ * @field
4189
+ */
4190
+ user_data: any
4191
+ }
4192
+
4193
+ /**
4194
+ * Data transport structure used internally by the plugins which support
4195
+ * query vmethod.
4196
+ * @record
4197
+ */
4198
+ export class SourceQuerySpec {
4199
+
4200
+ // Own properties of Grl-0.2.Grl.SourceQuerySpec
4201
+
4202
+ static name: string
4203
+ }
4204
+
4205
+ export interface SourceRemoveSpec {
4206
+
4207
+ // Own fields of Grl-0.2.Grl.SourceRemoveSpec
4208
+
4209
+ /**
4210
+ * a source
4211
+ * @field
4212
+ */
4213
+ source: Source
4214
+ /**
4215
+ * media identifier to remove
4216
+ * @field
4217
+ */
4218
+ media_id: string | null
4219
+ /**
4220
+ * a data transfer object
4221
+ * @field
4222
+ */
4223
+ media: Media
4224
+ /**
4225
+ * the user defined callback
4226
+ * @field
4227
+ */
4228
+ callback: SourceRemoveCb
4229
+ /**
4230
+ * the user data to pass in the callback
4231
+ * @field
4232
+ */
4233
+ user_data: any
4234
+ }
4235
+
4236
+ /**
4237
+ * Data transport structure used internally by the plugins which support
4238
+ * store vmethod.
4239
+ * @record
4240
+ */
4241
+ export class SourceRemoveSpec {
4242
+
4243
+ // Own properties of Grl-0.2.Grl.SourceRemoveSpec
4244
+
4245
+ static name: string
4246
+ }
4247
+
4248
+ export interface SourceResolveSpec {
4249
+
4250
+ // Own fields of Grl-0.2.Grl.SourceResolveSpec
4251
+
4252
+ /**
4253
+ * a source
4254
+ * @field
4255
+ */
4256
+ source: Source
4257
+ /**
4258
+ * operation identifier
4259
+ * @field
4260
+ */
4261
+ operation_id: number
4262
+ /**
4263
+ * a data transfer object
4264
+ * @field
4265
+ */
4266
+ media: Media
4267
+ /**
4268
+ * the #GList of #GrlKeyID<!-- -->s to request
4269
+ * @field
4270
+ */
4271
+ keys: any[]
4272
+ /**
4273
+ * options wanted for that operation
4274
+ * @field
4275
+ */
4276
+ options: OperationOptions
4277
+ /**
4278
+ * the user defined callback
4279
+ * @field
4280
+ */
4281
+ callback: SourceResolveCb
4282
+ /**
4283
+ * the user data to pass in the callback
4284
+ * @field
4285
+ */
4286
+ user_data: any
4287
+ }
4288
+
4289
+ /**
4290
+ * Data transport structure used internally by the plugins which support
4291
+ * resolve vmethod.
4292
+ * @record
4293
+ */
4294
+ export class SourceResolveSpec {
4295
+
4296
+ // Own properties of Grl-0.2.Grl.SourceResolveSpec
4297
+
4298
+ static name: string
4299
+ }
4300
+
4301
+ export interface SourceSearchSpec {
4302
+
4303
+ // Own fields of Grl-0.2.Grl.SourceSearchSpec
4304
+
4305
+ /**
4306
+ * a source
4307
+ * @field
4308
+ */
4309
+ source: Source
4310
+ /**
4311
+ * operation identifier
4312
+ * @field
4313
+ */
4314
+ operation_id: number
4315
+ /**
4316
+ * the text to search
4317
+ * @field
4318
+ */
4319
+ text: string | null
4320
+ /**
4321
+ * the #GList of #GrlKeyID<!-- -->s to request
4322
+ * @field
4323
+ */
4324
+ keys: any[]
4325
+ /**
4326
+ * options wanted for that operation
4327
+ * @field
4328
+ */
4329
+ options: OperationOptions
4330
+ /**
4331
+ * the user defined callback
4332
+ * @field
4333
+ */
4334
+ callback: SourceResultCb
4335
+ /**
4336
+ * the user data to pass in the callback
4337
+ * @field
4338
+ */
4339
+ user_data: any
4340
+ }
4341
+
4342
+ /**
4343
+ * Data transport structure used internally by the plugins which support
4344
+ * search vmethod.
4345
+ * @record
4346
+ */
4347
+ export class SourceSearchSpec {
4348
+
4349
+ // Own properties of Grl-0.2.Grl.SourceSearchSpec
4350
+
4351
+ static name: string
4352
+ }
4353
+
4354
+ export interface SourceStoreMetadataSpec {
4355
+
4356
+ // Own fields of Grl-0.2.Grl.SourceStoreMetadataSpec
4357
+
4358
+ /**
4359
+ * a source
4360
+ * @field
4361
+ */
4362
+ source: Source
4363
+ /**
4364
+ * a #GrlMedia transfer object
4365
+ * @field
4366
+ */
4367
+ media: Media
4368
+ /**
4369
+ * List of keys to be stored/updated.
4370
+ * @field
4371
+ */
4372
+ keys: any[]
4373
+ /**
4374
+ * Flags to control specific bahviors of the set metadata operation.
4375
+ * @field
4376
+ */
4377
+ flags: WriteFlags
4378
+ /**
4379
+ * the callback passed to grl_source_store_metadata()
4380
+ * @field
4381
+ */
4382
+ callback: SourceStoreCb
4383
+ /**
4384
+ * user data passed to grl_source_store_metadata()
4385
+ * @field
4386
+ */
4387
+ user_data: any
4388
+ /**
4389
+ * for internal use of the framework only.
4390
+ * @field
4391
+ */
4392
+ failed_keys: any[]
4393
+ }
4394
+
4395
+ /**
4396
+ * Data transport structure used internally by the plugins which support
4397
+ * store_metadata vmethod.
4398
+ * @record
4399
+ */
4400
+ export class SourceStoreMetadataSpec {
4401
+
4402
+ // Own properties of Grl-0.2.Grl.SourceStoreMetadataSpec
4403
+
4404
+ static name: string
4405
+ }
4406
+
4407
+ export interface SourceStoreSpec {
4408
+
4409
+ // Own fields of Grl-0.2.Grl.SourceStoreSpec
4410
+
4411
+ /**
4412
+ * a media source
4413
+ * @field
4414
+ */
4415
+ source: Source
4416
+ /**
4417
+ * a parent to store the data transfer objects
4418
+ * @field
4419
+ */
4420
+ parent: MediaBox
4421
+ /**
4422
+ * a data transfer object
4423
+ * @field
4424
+ */
4425
+ media: Media
4426
+ /**
4427
+ * the user defined callback
4428
+ * @field
4429
+ */
4430
+ callback: SourceStoreCb
4431
+ /**
4432
+ * the user data to pass in the callback
4433
+ * @field
4434
+ */
4435
+ user_data: any
4436
+ }
4437
+
4438
+ /**
4439
+ * Data transport structure used internally by the plugins which support
4440
+ * store vmethod.
4441
+ * @record
4442
+ */
4443
+ export class SourceStoreSpec {
4444
+
4445
+ // Own properties of Grl-0.2.Grl.SourceStoreSpec
4446
+
4447
+ static name: string
4448
+ }
4449
+
4450
+ export type KeyID = number
4451
+ /**
4452
+ * Name of the imported GIR library
4453
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
4454
+ */
4455
+ export const __name__: string
4456
+ /**
4457
+ * Version of the imported GIR library
4458
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
4459
+ */
4460
+ export const __version__: string
4461
+ // END