Mercurial > audlegacy-plugins
comparison src/flac/plugin.c @ 1070:aa85fe8d2473 trunk
[svn] - update FLAC plugin to plugin API v2
| author | nenolod |
|---|---|
| date | Thu, 24 May 2007 12:22:58 -0700 |
| parents | 1820b4026fe2 |
| children | cb1502e462f9 |
comparison
equal
deleted
inserted
replaced
| 1069:f04f4a223f7b | 1070:aa85fe8d2473 |
|---|---|
| 105 | 105 |
| 106 InputPlugin flac_ip = | 106 InputPlugin flac_ip = |
| 107 { | 107 { |
| 108 NULL, | 108 NULL, |
| 109 NULL, | 109 NULL, |
| 110 NULL, | 110 "FLAC Audio Plugin", |
| 111 FLAC_XMMS__init, | 111 FLAC_XMMS__init, |
| 112 FLAC_XMMS__aboutbox, | 112 FLAC_XMMS__aboutbox, |
| 113 FLAC_XMMS__configure, | 113 FLAC_XMMS__configure, |
| 114 FLAC_XMMS__is_our_file, | 114 FLAC_XMMS__is_our_file, |
| 115 NULL, | 115 NULL, |
| 134 NULL, | 134 NULL, |
| 135 FLAC_XMMS__is_our_file_from_vfs, | 135 FLAC_XMMS__is_our_file_from_vfs, |
| 136 flac_fmts, | 136 flac_fmts, |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 InputPlugin *flac_iplist[] = { &flac_ip, NULL }; | |
| 140 | |
| 141 DECLARE_PLUGIN(flac, NULL, NULL, flac_iplist, NULL, NULL, NULL, NULL); | |
| 142 | |
| 139 #define SAMPLES_PER_WRITE 512 | 143 #define SAMPLES_PER_WRITE 512 |
| 140 #define SAMPLE_BUFFER_SIZE ((FLAC__MAX_BLOCK_SIZE + SAMPLES_PER_WRITE) * FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS * (24/8)) | 144 #define SAMPLE_BUFFER_SIZE ((FLAC__MAX_BLOCK_SIZE + SAMPLES_PER_WRITE) * FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS * (24/8)) |
| 141 static FLAC__byte sample_buffer_[SAMPLE_BUFFER_SIZE]; | 145 static FLAC__byte sample_buffer_[SAMPLE_BUFFER_SIZE]; |
| 142 static unsigned sample_buffer_first_, sample_buffer_last_; | 146 static unsigned sample_buffer_first_, sample_buffer_last_; |
| 143 | 147 |
| 149 | 153 |
| 150 #define BITRATE_HIST_SEGMENT_MSEC 500 | 154 #define BITRATE_HIST_SEGMENT_MSEC 500 |
| 151 /* 500ms * 50 = 25s should be enough */ | 155 /* 500ms * 50 = 25s should be enough */ |
| 152 #define BITRATE_HIST_SIZE 50 | 156 #define BITRATE_HIST_SIZE 50 |
| 153 static unsigned bitrate_history_[BITRATE_HIST_SIZE]; | 157 static unsigned bitrate_history_[BITRATE_HIST_SIZE]; |
| 154 | |
| 155 #ifdef SUPPORT_ATTRIBUTE_VISIBILITY | |
| 156 InputPlugin *get_iplugin_info() __attribute__((visibility("default"))); | |
| 157 #endif | |
| 158 | |
| 159 InputPlugin *get_iplugin_info() | |
| 160 { | |
| 161 flac_ip.description = g_strdup_printf(_("FLAC Audio Plugin")); | |
| 162 return &flac_ip; | |
| 163 } | |
| 164 | 158 |
| 165 void set_track_info(const char* title, int length_in_msec) | 159 void set_track_info(const char* title, int length_in_msec) |
| 166 { | 160 { |
| 167 if (stream_data_.is_playing) { | 161 if (stream_data_.is_playing) { |
| 168 if ( !flac_cfg.title.disable_bitrate_update ) | 162 if ( !flac_cfg.title.disable_bitrate_update ) |
