Mercurial > hg > xmms-sid
comparison src/xmms-sid.c @ 688:ba851baac5a0
Etc.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 22 May 2008 07:26:26 +0300 |
parents | f22a708d29fd |
children | 4b0189df58ee |
comparison
equal
deleted
inserted
replaced
687:f22bda785ad6 | 688:ba851baac5a0 |
---|---|
259 | 259 |
260 | 260 |
261 /* | 261 /* |
262 * Check whether the given file is handled by this plugin | 262 * Check whether the given file is handled by this plugin |
263 */ | 263 */ |
264 gint xs_is_our_file(gchar *pcFilename) | 264 gint xs_is_our_file(gchar *filename) |
265 { | 265 { |
266 gchar *pcExt; | 266 gchar *ext; |
267 assert(xs_status.sidPlayer); | 267 assert(xs_status.sidPlayer); |
268 | 268 |
269 /* Check the filename */ | 269 /* Check the filename */ |
270 if (pcFilename == NULL) | 270 if (filename == NULL) |
271 return FALSE; | 271 return FALSE; |
272 | 272 |
273 /* Try to detect via detection routine, if required */ | 273 /* Try to detect via detection routine, if required */ |
274 if (xs_cfg.detectMagic) { | 274 if (xs_cfg.detectMagic) { |
275 xs_file_t *f; | 275 xs_file_t *f; |
276 if ((f = xs_fopen(pcFilename, "rb")) != NULL) { | 276 if ((f = xs_fopen(filename, "rb")) != NULL) { |
277 if (xs_status.sidPlayer->plrProbe(f)) | 277 if (xs_status.sidPlayer->plrProbe(f)) |
278 return TRUE; | 278 return TRUE; |
279 xs_fclose(f); | 279 xs_fclose(f); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 /* Detect just by checking filename extension */ | 283 /* Detect just by checking filename extension */ |
284 pcExt = xs_strrchr(pcFilename, '.'); | 284 ext = xs_strrchr(filename, '.'); |
285 if (pcExt) { | 285 if (ext) { |
286 pcExt++; | 286 ext++; |
287 switch (xs_cfg.playerEngine) { | 287 switch (xs_cfg.playerEngine) { |
288 case XS_ENG_SIDPLAY1: | 288 case XS_ENG_SIDPLAY1: |
289 case XS_ENG_SIDPLAY2: | 289 case XS_ENG_SIDPLAY2: |
290 if (!g_strcasecmp(pcExt, "psid")) | 290 if (!g_strcasecmp(ext, "psid")) |
291 return TRUE; | 291 return TRUE; |
292 if (!g_strcasecmp(pcExt, "sid")) | 292 if (!g_strcasecmp(ext, "sid")) |
293 return TRUE; | 293 return TRUE; |
294 if (!g_strcasecmp(pcExt, "dat")) | 294 if (!g_strcasecmp(ext, "dat")) |
295 return TRUE; | 295 return TRUE; |
296 if (!g_strcasecmp(pcExt, "inf")) | 296 if (!g_strcasecmp(ext, "inf")) |
297 return TRUE; | 297 return TRUE; |
298 if (!g_strcasecmp(pcExt, "info")) | 298 if (!g_strcasecmp(ext, "info")) |
299 return TRUE; | 299 return TRUE; |
300 break; | 300 break; |
301 } | 301 } |
302 } | 302 } |
303 | 303 |
563 * Start playing the given file | 563 * Start playing the given file |
564 * Here we load the tune and initialize the playing thread. | 564 * Here we load the tune and initialize the playing thread. |
565 * Usually you would also initialize the output-plugin, but | 565 * Usually you would also initialize the output-plugin, but |
566 * this is XMMS-SID and we do it on the player thread instead. | 566 * this is XMMS-SID and we do it on the player thread instead. |
567 */ | 567 */ |
568 void xs_play_file(gchar * pcFilename) | 568 void xs_play_file(gchar *filename) |
569 { | 569 { |
570 assert(xs_status.sidPlayer); | 570 assert(xs_status.sidPlayer); |
571 | 571 |
572 XSDEBUG("play '%s'\n", pcFilename); | 572 XSDEBUG("play '%s'\n", filename); |
573 | 573 |
574 /* Get tune information */ | 574 /* Get tune information */ |
575 if ((xs_status.tuneInfo = xs_status.sidPlayer->plrGetSIDInfo(pcFilename)) == NULL) | 575 if ((xs_status.tuneInfo = xs_status.sidPlayer->plrGetSIDInfo(filename)) == NULL) |
576 return; | 576 return; |
577 | 577 |
578 /* Initialize the tune */ | 578 /* Initialize the tune */ |
579 if (!xs_status.sidPlayer->plrLoadSID(&xs_status, pcFilename)) { | 579 if (!xs_status.sidPlayer->plrLoadSID(&xs_status, filename)) { |
580 xs_tuneinfo_free(xs_status.tuneInfo); | 580 xs_tuneinfo_free(xs_status.tuneInfo); |
581 xs_status.tuneInfo = NULL; | 581 xs_status.tuneInfo = NULL; |
582 return; | 582 return; |
583 } | 583 } |
584 | 584 |
651 | 651 |
652 | 652 |
653 /* | 653 /* |
654 * Pause/unpause the playing | 654 * Pause/unpause the playing |
655 */ | 655 */ |
656 void xs_pause(short pauseState) | 656 void xs_pause(short pause) |
657 { | 657 { |
658 XS_MUTEX_LOCK(xs_status); | 658 XS_MUTEX_LOCK(xs_status); |
659 /* FIXME FIX ME todo: pause should disable sub-tune controls */ | 659 /* FIXME FIX ME todo: pause should disable sub-tune controls */ |
660 XS_MUTEX_UNLOCK(xs_status); | 660 XS_MUTEX_UNLOCK(xs_status); |
661 | 661 |
662 xs_subctrl_close(); | 662 xs_subctrl_close(); |
663 xs_fileinfo_update(); | 663 xs_fileinfo_update(); |
664 xs_plugin_ip.output->pause(pauseState); | 664 xs_plugin_ip.output->pause(pause); |
665 } | 665 } |
666 | 666 |
667 | 667 |
668 /* | 668 /* |
669 * Pop-up subtune selector | 669 * Pop-up subtune selector |