void open(service_ptr_t<file> p_filehint,const char * p_path,t_input_open_reason p_reason,abort_callback & p_abort) { if ( p_reason == input_open_info_write ) { throw exception_io_unsupported_format(); // our input does not support retagging. } m_file = p_filehint; // p_filehint may be null, hence next line input_open_file_helper(m_file,p_path,p_reason,p_abort); // if m_file is null, opens file with appropriate privileges for our operation (read/write for writing tags, read-only otherwise). if ( m_file->get_size( p_abort ) >= (std::numeric_limits<std::size_t>::max)() ) { throw exception_io_unsupported_format(); } std::vector<char> data( static_cast<std::size_t>( m_file->get_size( p_abort ) ) ); m_file->read( data.data(), data.size(), p_abort ); try { std::map< std::string, std::string > ctls; ctls["seek.sync_samples"] = "1"; mod = new openmpt::module( data, std::clog, ctls ); } catch ( std::exception & /*e*/ ) { throw exception_io_data(); } settings = foo_openmpt_settings(); mod->set_repeat_count( settings.repeatcount ); mod->set_render_param( openmpt::module::RENDER_MASTERGAIN_MILLIBEL, settings.mastergain_millibel ); mod->set_render_param( openmpt::module::RENDER_STEREOSEPARATION_PERCENT, settings.stereoseparation ); mod->set_render_param( openmpt::module::RENDER_INTERPOLATIONFILTER_LENGTH, settings.interpolationfilterlength ); mod->set_render_param( openmpt::module::RENDER_VOLUMERAMPING_STRENGTH, settings.ramping ); mod->ctl_set( "render.resampler.emulate_amiga", settings.use_amiga_resampler ? "1" : "0" ); }
void open(service_ptr_t<file> file, const char *path, t_input_open_reason reason, abort_callback &abort) { m_pfile = file; input_open_file_helper(m_pfile, path, reason, abort); m_pfile->ensure_seekable(); m_demuxer = std::make_shared<CAFFile>(m_pfile, abort); m_decoder = IDecoder::create_decoder(m_demuxer, abort); }
void open(service_ptr_t<file> m_file, const char * p_path, t_input_open_reason p_reason, abort_callback & p_abort) { if (p_reason == input_open_info_write) { throw exception_io_data(); } input_open_file_helper(m_file, p_path, p_reason, p_abort); m_stats = m_file->get_stats(p_abort); m_decoder = new dts_decode(); if (!m_decoder->load( m_file, p_abort)) { throw exception_io_data(); } }
void open( service_ptr_t<file> m_file, const char * p_path, t_input_open_reason p_reason, abort_callback & p_abort ) { if ( p_reason == input_open_info_write ) throw exception_io_data(); input_open_file_helper( m_file, p_path, p_reason, p_abort ); m_stats = m_file->get_stats( p_abort ); t_uint8 * ptr; unsigned size; t_filesize size64 = m_file->get_size_ex( p_abort ); if ( size64 > ( 1 << 24 ) ) throw exception_io_data(); size = (unsigned) size64; file_buffer.set_size( size ); ptr = file_buffer.get_ptr(); m_file->read_object( ptr, size, p_abort ); m_player = ModPlug_Load(ptr, size); if ( !m_player ) throw exception_io_data(); }
void open(service_ptr_t<file> p_filehint,const char * p_path,t_input_open_reason p_reason,abort_callback & p_abort) { if (p_reason == input_open_info_write) throw exception_io_unsupported_format();//our input does not support retagging. m_file = p_filehint;//p_filehint may be null, hence next line input_open_file_helper(m_file,p_path,p_reason,p_abort);//if m_file is null, opens file with appropriate privileges for our operation (read/write for writing tags, read-only otherwise). }