MCPcopy Create free account
hub / github.com/EasyRPG/Player / Open

Method Open

src/decoder_xmp.cpp:74–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74bool 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
103bool XMPDecoder::Seek(std::streamoff offset, std::ios_base::seekdir origin) {
104 if (!ctx)

Callers 4

CreateMethod · 0.45
CreateSeDecoderMethod · 0.45
PlayOnChannelMethod · 0.45
BGM_PlayMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected