Mercurial > hg > xmms-sid
comparison src/xs_sidplay2.cc @ 460:9e683fb666ba
Updates
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 24 Jan 2007 22:10:00 +0000 |
parents | f277dad3180f |
children | 9dafc55c4270 |
comparison
equal
deleted
inserted
replaced
459:023fed5602f3 | 460:9e683fb666ba |
---|---|
22 */ | 22 */ |
23 #include "xmms-sid.h" | 23 #include "xmms-sid.h" |
24 | 24 |
25 #ifdef HAVE_SIDPLAY2 | 25 #ifdef HAVE_SIDPLAY2 |
26 | 26 |
27 #include <stdio.h> | |
27 #include "xs_sidplay2.h" | 28 #include "xs_sidplay2.h" |
28 #include <stdio.h> | |
29 #include "xs_config.h" | 29 #include "xs_config.h" |
30 #include "xs_support.h" | 30 #include "xs_support.h" |
31 | 31 |
32 | 32 |
33 #include <sidplay/sidplay2.h> | 33 #include <sidplay/sidplay2.h> |
51 extern "C" { | 51 extern "C" { |
52 | 52 |
53 | 53 |
54 /* Check if we can play the given file | 54 /* Check if we can play the given file |
55 */ | 55 */ |
56 gboolean xs_sidplay2_isourfile(gchar * pcFilename) | 56 gboolean xs_sidplay2_isourfile(gchar *pcFilename) |
57 { | 57 { |
58 SidTune *testTune = new SidTune(pcFilename); | 58 SidTune *testTune = new SidTune(pcFilename); |
59 | 59 |
60 if (!testTune) return FALSE; | 60 if (!testTune) return FALSE; |
61 | 61 |
67 delete testTune; | 67 delete testTune; |
68 return TRUE; | 68 return TRUE; |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 | |
73 /* Initialize SIDPlay2 | 72 /* Initialize SIDPlay2 |
74 */ | 73 */ |
75 gboolean xs_sidplay2_init(t_xs_status * myStatus) | 74 gboolean xs_sidplay2_init(t_xs_ t_xs_status * myStatus) |
76 { | 75 { |
77 gint tmpFreq; | 76 gint tmpFreq; |
78 t_xs_sidplay2 *myEngine; | 77 t_xs_sidplay2 *myEngine; |
79 assert(myStatus); | 78 assert(myStatus); |
80 | 79 |
374 if (myEngine->currEng->load(myEngine->currTune) < 0) { | 373 if (myEngine->currEng->load(myEngine->currTune) < 0) { |
375 xs_error(_("[SIDPlay2] currEng->load() failed\n")); | 374 xs_error(_("[SIDPlay2] currEng->load() failed\n")); |
376 return FALSE; | 375 return FALSE; |
377 } | 376 } |
378 | 377 |
379 myEngine->isInitialized = TRUE; | 378 myStatus->isInitialized = TRUE; |
380 | 379 |
381 return TRUE; | 380 return TRUE; |
382 } | 381 } |
383 | 382 |
384 | 383 |
396 } | 395 } |
397 | 396 |
398 | 397 |
399 /* Load a given SID-tune file | 398 /* Load a given SID-tune file |
400 */ | 399 */ |
401 gboolean xs_sidplay2_loadsid(t_xs_status * myStatus, gchar * pcFilename) | 400 gboolean xs_sidplay2_load(t_xs_status * myStatus, gchar * pcFilename) |
402 { | 401 { |
403 t_xs_sidplay2 *myEngine; | 402 t_xs_sidplay2 *myEngine; |
404 assert(myStatus); | 403 assert(myStatus); |
405 | 404 |
406 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; | 405 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; |
407 if (!myEngine) return FALSE; | 406 if (!myEngine) return FALSE; |
408 | 407 |
409 myEngine->isInitialized = FALSE; | 408 myStatus->isInitialized = FALSE; |
410 | 409 |
411 /* Try to get the tune */ | 410 /* Try to get the tune */ |
412 if (!pcFilename) return FALSE; | 411 if (!pcFilename) return FALSE; |
413 | 412 |
414 if (!myEngine->currTune->load(pcFilename)) | 413 if (!myEngine->currTune->load(pcFilename)) |
418 } | 417 } |
419 | 418 |
420 | 419 |
421 /* Delete INTERNAL information | 420 /* Delete INTERNAL information |
422 */ | 421 */ |
423 void xs_sidplay2_deletesid(t_xs_status * myStatus) | 422 void xs_sidplay2_delete(t_xs_status * myStatus) |
424 { | 423 { |
425 assert(myStatus); | 424 assert(myStatus); |
426 | 425 |
427 /* With the current scheme of handling sidtune-loading, we don't do anything here. */ | 426 /* With the current scheme of handling sidtune-loading, we don't do anything here. */ |
428 } | 427 } |
429 | 428 |
430 | 429 |
431 /* Return song information | 430 /* Return song information |
432 */ | 431 */ |
433 #define TFUNCTION xs_sidplay2_getsidinfo | 432 #define TFUNCTION xs_sidplay2_getinfo |
433 #define TFUNCTION2 xs_sidplay2_updateinfo | |
434 #define TTUNEINFO SidTuneInfo | 434 #define TTUNEINFO SidTuneInfo |
435 #define TTUNE SidTune | 435 #define TTUNE SidTune |
436 #include "xs_sidplay.h" | 436 #include "xs_sidplay.h" |
437 | 437 |
438 } /* extern "C" */ | 438 } /* extern "C" */ |