add last backwards-compatible version
This commit is contained in:
@@ -7,32 +7,29 @@ class input_helper {
|
||||
public:
|
||||
input_helper();
|
||||
|
||||
typedef std::function<input_decoder::ptr (input_decoder::ptr, const char*, abort_callback&) > shim_t;
|
||||
|
||||
typedef std::function< bool ( file::ptr &, const char *, abort_callback & ) > ioFilter_t;
|
||||
typedef std::list<ioFilter_t> ioFilters_t;
|
||||
|
||||
struct decodeInfo_t {
|
||||
bool m_flush_on_pause;
|
||||
bool m_can_seek;
|
||||
#ifdef FOOBAR2000_MODERN
|
||||
bool m_seeking_expensive;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct decodeOpen_t {
|
||||
bool m_from_redirect = false;
|
||||
bool m_skip_hints = false;
|
||||
unsigned m_flags = 0;
|
||||
file::ptr m_hint;
|
||||
unsigned m_setSampleRate = 0;
|
||||
|
||||
ioFilters_t m_ioFilters;
|
||||
decodeOpen_t() : m_from_redirect(), m_skip_hints(), m_flags() {}
|
||||
event_logger::ptr m_logger;
|
||||
shim_t m_shim;
|
||||
bool m_from_redirect;
|
||||
bool m_skip_hints;
|
||||
unsigned m_flags;
|
||||
file::ptr m_hint;
|
||||
ioFilters_t m_ioFilters;
|
||||
};
|
||||
|
||||
void open(service_ptr_t<file> p_filehint,metadb_handle_ptr p_location,unsigned p_flags,abort_callback & p_abort,bool p_from_redirect = false,bool p_skip_hints = false);
|
||||
void open(service_ptr_t<file> p_filehint,const playable_location & p_location,unsigned p_flags,abort_callback & p_abort,bool p_from_redirect = false,bool p_skip_hints = false);
|
||||
void attach(input_decoder::ptr dec, const char * path);
|
||||
|
||||
void open(const playable_location & location, abort_callback & abort, decodeOpen_t const & other);
|
||||
void open(metadb_handle_ptr location, abort_callback & abort, decodeOpen_t const & other) {this->open(location->get_location(), abort, other);}
|
||||
@@ -54,7 +51,9 @@ public:
|
||||
bool run_raw(audio_chunk & p_chunk, mem_block_container & p_raw, abort_callback & p_abort);
|
||||
void seek(double seconds,abort_callback & p_abort);
|
||||
bool can_seek();
|
||||
#ifdef FOOBAR2000_MODERN
|
||||
size_t extended_param( const GUID & type, size_t arg1, void * arg2, size_t arg2size);
|
||||
#endif
|
||||
static ioFilter_t ioFilter_full_buffer(t_filesize val );
|
||||
static ioFilter_t ioFilter_block_buffer(size_t val);
|
||||
static ioFilter_t ioFilter_remote_read_ahead( size_t val );
|
||||
@@ -67,11 +66,6 @@ public:
|
||||
void set_pause(bool state);
|
||||
bool flush_on_pause();
|
||||
|
||||
//! If this decoder has its own special position reporting, decoder-signaled logical decoding position will be returned. \n
|
||||
//! Otherwise, position calculated from returned audio duration should be assumed. \n
|
||||
//! Very few special-purpose decoders do this.
|
||||
bool query_position( double & val );
|
||||
|
||||
//! Retrieves path of currently open file.
|
||||
const char * get_path() const;
|
||||
|
||||
@@ -88,7 +82,6 @@ private:
|
||||
void fileOpenTools(service_ptr_t<file> & p_file,const char * p_path, ioFilters_t const & filters, abort_callback & p_abort);
|
||||
service_ptr_t<input_decoder> m_input;
|
||||
pfc::string8 m_path;
|
||||
event_logger::ptr m_logger;
|
||||
};
|
||||
|
||||
class NOVTABLE dead_item_filter : public abort_callback {
|
||||
@@ -112,6 +105,32 @@ private:
|
||||
|
||||
|
||||
|
||||
class input_helper_cue {
|
||||
public:
|
||||
void open(service_ptr_t<file> p_filehint,const playable_location & p_location,unsigned p_flags,abort_callback & p_abort,double p_start,double p_length);
|
||||
|
||||
void close();
|
||||
bool is_open();
|
||||
bool run(audio_chunk & p_chunk,abort_callback & p_abort);
|
||||
bool run_raw(audio_chunk & p_chunk, mem_block_container & p_raw, abort_callback & p_abort);
|
||||
void seek(double seconds,abort_callback & p_abort);
|
||||
bool can_seek();
|
||||
void on_idle(abort_callback & p_abort);
|
||||
bool get_dynamic_info(file_info & p_out,double & p_timestamp_delta);
|
||||
bool get_dynamic_info_track(file_info & p_out,double & p_timestamp_delta);
|
||||
void set_logger(event_logger::ptr ptr) {m_input.set_logger(ptr);}
|
||||
|
||||
const char * get_path() const;
|
||||
|
||||
void get_info(t_uint32 p_subsong,file_info & p_info,abort_callback & p_abort);
|
||||
|
||||
private:
|
||||
bool _run(audio_chunk & p_chunk, mem_block_container * p_raw, abort_callback & p_abort);
|
||||
bool _m_input_run(audio_chunk & p_chunk, mem_block_container * p_raw, abort_callback & p_abort);
|
||||
input_helper m_input;
|
||||
double m_start,m_length,m_position;
|
||||
bool m_dynamic_info_trigger,m_dynamic_info_track_trigger;
|
||||
};
|
||||
|
||||
//! openAudioData return value, see openAudioData()
|
||||
struct openAudioData_t {
|
||||
|
||||
Reference in New Issue
Block a user