| 72 | } |
| 73 | |
| 74 | bool XMPDecoder::Open(Filesystem_Stream::InputStream stream) { |
| 75 | finished = false; |
| 76 | |
| 77 | if (!ctx) |
| 78 | return false; |
| 79 | |
| 80 | int res = xmp_load_module_from_callbacks(ctx, &stream, vio); |
| 81 | if (res != 0) { |
| 82 | error_message = "XMP: Error loading file"; |
| 83 | return false; |
| 84 | } |
| 85 | |
| 86 | xmp_start_player(ctx, frequency, 0); |
| 87 | |
| 88 | int player_interpolation = 0; |
| 89 | int player_effects = 0; |
| 90 | #if defined(PSP) || defined(__3DS__) || defined(__wii__) |
| 91 | // disable filtering and use low quality interpolation |
| 92 | player_interpolation = XMP_INTERP_NEAREST; |
| 93 | #else |
| 94 | player_interpolation = XMP_INTERP_SPLINE; |
| 95 | player_effects = XMP_DSP_ALL; |
| 96 | #endif |
| 97 | xmp_set_player(ctx, XMP_PLAYER_INTERP, player_interpolation); |
| 98 | xmp_set_player(ctx, XMP_PLAYER_DSP, player_effects); |
| 99 | |
| 100 | return true; |
| 101 | } |
| 102 | |
| 103 | bool XMPDecoder::Seek(std::streamoff offset, std::ios_base::seekdir origin) { |
| 104 | if (!ctx) |
no outgoing calls
no test coverage detected