16 if (ptr->is_our_path(p_path)) {
28 if (ptr->supports_pregaps() && ptr->is_our_path(p_path)) {
37 t_uint64 ticks = audio_math::time_to_samples(p_time,75);
38 t_uint64 seconds = ticks / 75; ticks %= 75;
39 t_uint64 minutes = seconds / 60; seconds %= 60;
54 for(ptr=0;ptr<p_length;ptr++)
56 if (p_string[ptr] ==
':')
58 if (splitptr >= 2)
throw std::runtime_error(
"invalid INDEX time syntax");
59 splitmarks[splitptr++] = ptr;
61 else if (!
pfc::char_is_numeric(p_string[ptr]))
throw std::runtime_error(
"invalid INDEX time syntax");
64 t_size minutes_base = 0, minutes_length = 0, seconds_base = 0, seconds_length = 0, frames_base = 0, frames_length = 0;
70 frames_length = p_length;
74 seconds_length = splitmarks[0];
75 frames_base = splitmarks[0] + 1;
76 frames_length = p_length - frames_base;
80 minutes_length = splitmarks[0];
81 seconds_base = splitmarks[0] + 1;
82 seconds_length = splitmarks[1] - seconds_base;
83 frames_base = splitmarks[1] + 1;
84 frames_length = p_length - frames_base;
90 if (frames_length > 0) ret +=
pfc::atoui_ex(p_string + frames_base,frames_length);
91 if (seconds_length > 0) ret += 75 *
pfc::atoui_ex(p_string + seconds_base,seconds_length);
92 if (minutes_length > 0) ret += 60 * 75 *
pfc::atoui_ex(p_string + minutes_base,minutes_length);
Interface for object storing list of chapters.
static bool g_find(service_ptr_t< chapterizer > &p_out, const char *p_path)
Static helper, tries to find chapterizer interface that supports specified file.
virtual const file_info & get_info(t_size p_chapter) const =0
Queries description of specified chapter.
virtual void set_info(t_size p_chapter, const file_info &p_info)=0
Modifies description of specified chapter.
static bool g_is_pregap_capable(const char *p_path)
t_size strlen_max(const char *ptr, t_size max)
virtual void set_chapter_count(t_size p_count)=0
Sets number of chapters.
virtual t_size get_chapter_count() const =0
Returns number of chapters.
virtual double get_pregap() const =0
unsigned atoui_ex(const char *p_string, t_size p_string_len)
unsigned cuesheet_parse_index_time_ticks_e(const char *p_string, t_size p_length)
virtual void set_pregap(double val)=0
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
bool char_is_numeric(char_t p_char)
double cuesheet_parse_index_time_e(const char *p_string, t_size p_length)
bool next(service_ptr_t< t_query > &p_out)
void copy(const chapter_list &p_source)
Copies contents of specified chapter_list object to this object.