Ignore:
Timestamp:
06/18/11 14:56:45 (13 years ago)
Author:
r2d
Message:

audacious-musepack : update to audacious v2.4.4
some API function used are deprecated, we should implement the play() function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • audacious-musepack/trunk/libmpc.cpp

    r468 r472  
    6262    VFSFile *file = (VFSFile *) d->data;
    6363
    64     return (mpc_int32_t) aud_vfs_fread(ptr, 1, size, file);
     64    return (mpc_int32_t) vfs_fread(ptr, 1, size, file);
    6565}
    6666
     
    7070    VFSFile *file = (VFSFile *) d->data;
    7171
    72         return d->canseek(d) ? aud_vfs_fseek(file, offset, SEEK_SET) == 0 : FALSE;
     72        return d->canseek(d) ? vfs_fseek(file, offset, SEEK_SET) == 0 : FALSE;
    7373}
    7474
     
    7878    VFSFile *file = (VFSFile *) d->data;
    7979
    80     return aud_vfs_ftell(file);
     80    return vfs_ftell(file);
    8181}
    8282
     
    8787        VFSFile *file = (VFSFile *) d->data;
    8888
    89         f_pos = aud_vfs_ftell(file);
    90         aud_vfs_fseek(file, 0, SEEK_END);
    91         f_size = aud_vfs_ftell(file);
    92         aud_vfs_fseek(file, f_pos, SEEK_SET);
     89        f_pos = vfs_ftell(file);
     90        if (vfs_fseek(file, 0, SEEK_END) != 0) {
     91        AUDDBG("Could not seek to the end of file\n");
     92                return 0;
     93        }
     94        f_size = vfs_ftell(file);
     95        if (vfs_fseek(file, f_pos, SEEK_SET) != 0)
     96        AUDDBG("Could not seek to %d\n", f_pos);
    9397
    9498        return f_size;
     
    115119    p_reader->canseek = aud_vfs_canseek_impl;
    116120        p_reader->data = input; // no worries, it gets cast back -nenolod
    117         aud_vfs_fseek(input, 0, SEEK_SET);
     121        if (vfs_fseek(input, 0, SEEK_SET) != 0)
     122        AUDDBG("Could not seek to the beginning of file\n");
    118123}
    119124
     
    138143        char* titleText      = g_strdup_printf(_("Musepack Decoder Plugin %s"), VERSION);
    139144        const char* contentText = _("Plugin code by\nBenoit Amiaux\nMartin Spuler\nKuniklo\nNicolas Botti\n\nGet latest version at http://musepack.net\n");
    140         const char* buttonText  = _("Nevermind");
    141         aboutBox = audacious_info_dialog(titleText, contentText, buttonText, FALSE, NULL, NULL);
     145                audgui_simple_message (& aboutBox, GTK_MESSAGE_INFO, titleText, contentText);
    142146        widgets.aboutBox = aboutBox;
    143147        g_signal_connect(G_OBJECT(aboutBox), "destroy", G_CALLBACK(gtk_widget_destroyed), &widgets.aboutBox);
     
    271275{
    272276    gchar magic[4];
    273     aud_vfs_fread(magic, 1, 4, file);
     277    if (4 != vfs_fread(magic, 1, 4, file))
     278                return 0;
    274279    if (memcmp(magic, "MP+", 3) == 0)
    275280        return 1;
     
    419424
    420425        if (input == 0) {
    421                 input = aud_vfs_fopen(p_Filename, "rb");
     426                input = vfs_fopen(p_Filename, "rb");
    422427                if (input == 0) {
    423428                        gchar* temp = g_strdup_printf("[xmms-musepack] mpcGetTuple is unable to open %s\n", p_Filename);
     
    429434        }
    430435
    431         tuple = aud_tuple_new_from_filename(p_Filename);
     436        tuple = tuple_new_from_filename(p_Filename);
    432437
    433438        mpc_streaminfo info;
     
    438443        mpc_demux_exit(demux);
    439444
    440         aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, static_cast<int> (1000 * mpc_streaminfo_get_length(&info)));
     445        tuple_associate_int(tuple, FIELD_LENGTH, NULL, static_cast<int> (1000 * mpc_streaminfo_get_length(&info)));
    441446
    442447        gchar *scratch = g_strdup_printf("Musepack v%d (encoder %s)", info.stream_version, info.encoder);
    443         aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, scratch);
     448        tuple_associate_string(tuple, FIELD_CODEC, NULL, scratch);
    444449        g_free(scratch);
    445450
    446451        scratch = g_strdup_printf("lossy (%s)", info.profile_name);
    447         aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, scratch);
     452        tuple_associate_string(tuple, FIELD_QUALITY, NULL, scratch);
    448453        g_free(scratch);
    449454
    450         aud_tuple_associate_int(tuple, FIELD_BITRATE, NULL, static_cast<int> (info.average_bitrate / 1000));
     455        tuple_associate_int(tuple, FIELD_BITRATE, NULL, static_cast<int> (info.average_bitrate / 1000));
    451456
    452457        MpcInfo tags = getTags(p_Filename);
    453458
    454         aud_tuple_associate_string(tuple, FIELD_DATE, NULL, tags.date);
    455         aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, tags.title);
    456         aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, tags.artist);
    457         aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, tags.album);
    458         aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, tags.track);
    459         aud_tuple_associate_int(tuple, FIELD_YEAR, NULL, tags.year);
    460         aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, tags.genre);
    461         aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, tags.comment);
     459        tuple_associate_string(tuple, FIELD_DATE, NULL, tags.date);
     460        tuple_associate_string(tuple, FIELD_TITLE, NULL, tags.title);
     461        tuple_associate_string(tuple, FIELD_ARTIST, NULL, tags.artist);
     462        tuple_associate_string(tuple, FIELD_ALBUM, NULL, tags.album);
     463        tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, tags.track);
     464        tuple_associate_int(tuple, FIELD_YEAR, NULL, tags.year);
     465        tuple_associate_string(tuple, FIELD_GENRE, NULL, tags.genre);
     466        tuple_associate_string(tuple, FIELD_COMMENT, NULL, tags.comment);
    462467
    463468        freeTags(tags);
    464469
    465470        if (close_input)
    466                 aud_vfs_fclose(input);
     471                vfs_fclose(input);
    467472
    468473        return tuple;
     
    644649        GtkWidget* albumGainLabel = mpcGtkLabel(infoVbox);
    645650
    646         VFSFile *input = aud_vfs_fopen(p_Filename, "rb");
     651        VFSFile *input = vfs_fopen(p_Filename, "rb");
    647652        if(input)
    648653        {
     
    689694            g_free(entry);
    690695            freeTags(tags);
    691             aud_vfs_fclose(input);
     696            vfs_fclose(input);
    692697        }
    693698        else
     
    726731    mpcDecoder.isAlive = false;
    727732    if(p_FileHandle)
    728         aud_vfs_fclose(p_FileHandle);
     733        vfs_fclose(p_FileHandle);
    729734    return 0;
    730735}
     
    755760    lockAcquire();
    756761    gchar* filename = data->filename;
    757     VFSFile *input = aud_vfs_fopen(filename, "rb");
     762    VFSFile *input = vfs_fopen(filename, "rb");
    758763    if (!input)
    759764    {
     
    847852    mpcConfigBox, // configure : Show Configure box
    848853    0, // PluginPreferences *settings
     854        0, // sendmsg
    849855
    850856    0, // gboolean have_subtune : Plugin supports/uses subtunes.
    851857    (gchar **)mpc_fmts, // vfs_extensions
    852     0, // GList *(*scan_dir) (gchar * dirname);
    853         0, // is_our_file
     858    0, // priority
    854859    mpcIsOurFD, // is_our_file_from_vfs
     860    mpcGetSongTuple, // get_song_tuple : Acquire tuple for song
    855861        mpcProbeForTuple, // Tuple *(*probe_for_tuple)(gchar *uri, VFSFile *fd);
    856     mpcPlay, // play_file
     862    0, //     gboolean (*update_song_tuple)(Tuple *tuple, VFSFile *fd);
     863        mpcFileInfoBox, // file_info_box : Show File Info Box
     864        0, // get_song_image
     865        0, // play
     866    mpcPause, // pause
     867        mpcSeekm, // void (*mseek) (InputPlayback * playback, gulong millisecond);
    857868    mpcStop, // stop
    858     mpcPause, // pause
    859     mpcSeek, // seek
    860         mpcSeekm, // void (*mseek) (InputPlayback * playback, gulong millisecond);
    861869        0, // get_time
    862870        0, // get_volume
    863871        0, // set_volume
    864         mpcFileInfoBox, // file_info_box : Show File Info Box
    865     mpcGetSongTuple, // get_song_tuple : Acquire tuple for song
    866     0, //     gboolean (*update_song_tuple)(Tuple *tuple, VFSFile *fd);
    867     0 //gint priority; /* 0 = first, 10 = last */
     872       
     873        /* Deprecated */
     874        0, // is_our_file
     875    mpcPlay, // play_file
     876    mpcSeek, // seek
    868877};
    869878
Note: See TracChangeset for help on using the changeset viewer.