Differenze tra le versioni di "Sapere con le funzioni esterne del API di Rhythmbox se un file contiene dati audio e/o video"
Da Gambas-it.org - Wikipedia.
Riga 1: | Riga 1: | ||
Con alcune funzioni esterne del API di ''Rhythmbox'' è possibile sapere se un file contiene dati audio e/o video. | Con alcune funzioni esterne del API di ''Rhythmbox'' è possibile sapere se un file contiene dati audio e/o video. | ||
− | E' necessario avere installata nel sistema e richiamare in Gambas la libreria condivisa: "''librhythmbox-core.so.10.0.0''" | + | E' necessario avere installata nel sistema e richiamare in Gambas la libreria condivisa: "''librhythmbox-core.so.10.0.0'' ". |
Mostriamo di seguito un esempio pratico: | Mostriamo di seguito un esempio pratico: | ||
− | Library "librhythmbox-core:10" | + | Library "librhythmbox-core:10.0.0" |
<FONT Color=gray>' ''RBMetaData *rb_metadata_new (void)'' | <FONT Color=gray>' ''RBMetaData *rb_metadata_new (void)'' | ||
Riga 47: | Riga 47: | ||
'''End''' | '''End''' | ||
− | |||
Versione delle 20:22, 28 dic 2021
Con alcune funzioni esterne del API di Rhythmbox è possibile sapere se un file contiene dati audio e/o video.
E' necessario avere installata nel sistema e richiamare in Gambas la libreria condivisa: "librhythmbox-core.so.10.0.0 ".
Mostriamo di seguito un esempio pratico:
Library "librhythmbox-core:10.0.0" ' RBMetaData *rb_metadata_new (void) ' Creates a new metadata backend instance. Private Extern rb_metadata_new() As Pointer ' void rb_metadata_load (RBMetaData *md, const char *uri, GError **error) ' Reads metadata information from the specified URI. Private Extern rb_metadata_load(md As Pointer, uri As String, gerror As Pointer) ' gboolean rb_metadata_has_audio (RBMetaData *md) ' Retrieves the value of a metadata field extracted from the target URI. Private Extern rb_metadata_has_audio(md As Pointer) As Boolean ' gboolean rb_metadata_has_video (RBMetaData *md) ' Retrieves the value of a metadata field extracted from the target URI. Private Extern rb_metadata_has_video(md As Pointer) As Boolean ' void gst_object_unref(gpointer object) ' Decrements the reference count on object. Private Extern gst_object_unref(gobject As Pointer) Public Sub Main() Dim uri as String Dim met As Pointer Dim bo as Boolean uri = "file://" met = rb_metadata_new() rb_metadata_load(met, uri & "/percorso/del/file", 0) bo = rb_metadata_has_audio(met) Print bo bo = rb_metadata_has_video(met) Print bo gst_object_unref(met) End