// check for isofs volume_id for dvd/cdrom
static int udf_volume_id(const char *path, char *fname)
{
// check for isofs volume_id for dvd/cdrom
static int udf_volume_id(const char *path, char *fname)
{
struct stat st;
if( stat(path,&st) ) return 1;
// search mounted devices
FILE *fp = fopen("/proc/mounts","r");
if( !fp ) return 1;
struct stat st;
if( stat(path,&st) ) return 1;
// search mounted devices
FILE *fp = fopen("/proc/mounts","r");
if( !fp ) return 1;
while( result && !feof(fp) && !ferror(fp) ) {
char devpath[BCTEXTLEN], mpath[BCTEXTLEN];
char options[BCTEXTLEN], line[BCTEXTLEN];
while( result && !feof(fp) && !ferror(fp) ) {
char devpath[BCTEXTLEN], mpath[BCTEXTLEN];
char options[BCTEXTLEN], line[BCTEXTLEN];
char index_filename[BCTEXTLEN];
char source_filename[BCTEXTLEN];
const char *path = indexable->path;
char index_filename[BCTEXTLEN];
char source_filename[BCTEXTLEN];
const char *path = indexable->path;
get_index_filename(source_filename,
preferences->index_directory,
index_filename, path, suffix);
get_index_filename(source_filename,
preferences->index_directory,
index_filename, path, suffix);
+void IndexFile::delete_index_files(Preferences *preferences,
+ Indexable *indexable)
+{
+ delete_index(preferences, indexable, ".toc");
+ delete_index(preferences, indexable, ".idx");
+ delete_index(preferences, indexable, ".mkr");
+}
+
+
FileSystem fs;
asset->index_state->index_bytes = fs.get_size(asset->path);
source_length = source->get_audio_length();
FileSystem fs;
asset->index_state->index_bytes = fs.get_size(asset->path);
source_length = source->get_audio_length();
command.command = NORMAL_FWD;
command.get_edl()->copy_all((EDL*)indexable);
command.change_type = CHANGE_ALL;
command.command = NORMAL_FWD;
command.get_edl()->copy_all((EDL*)indexable);
command.change_type = CHANGE_ALL;
- int center_pixel = mwindow->edl->local_session->zoom_track / 2;
+ int rect_audio = mwindow->preferences->rectify_audio;
+ int data_h = edit->track->data_h;
+ int center_pixel = !rect_audio ? data_h/2 : data_h;
if( edit->track->show_titles() )
center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
if( edit->track->show_titles() )
center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
- int zoom_y = mwindow->edl->local_session->zoom_y, zoom_y2 = zoom_y / 2;
- int max_y = center_pixel + zoom_y2 - 1;
+ int zoom_y = mwindow->edl->local_session->zoom_y * data_h /
+ mwindow->edl->local_session->zoom_atrack;
+ if( !rect_audio ) zoom_y /= 2;
+ int max_y = center_pixel + zoom_y - 1;
edit_position = (x + pixmap->pixmap_x - virtual_edit_x) * project_zoom;
int64_t speed_position = edit->startsource;
speed_position += !speed_autos ? edit_position :
edit_position = (x + pixmap->pixmap_x - virtual_edit_x) * project_zoom;
int64_t speed_position = edit->startsource;
speed_position += !speed_autos ? edit_position :
- float highsample = buffer[i]; ++i;
- float lowsample = buffer[i]; ++i;
+ float highsample = !rect_audio ? buffer[i] : fabsf(buffer[i]); ++i;
+ float lowsample = !rect_audio ? buffer[i] : fabsf(buffer[i]); ++i;
int x2 = x1 + x + 1;
edit_position = (x2 + pixmap->pixmap_x - virtual_edit_x) * project_zoom;
int64_t speed_position = edit->startsource;
int x2 = x1 + x + 1;
edit_position = (x2 + pixmap->pixmap_x - virtual_edit_x) * project_zoom;
int64_t speed_position = edit->startsource;
int64_t k = 2 * index_position - start_index;
CLAMP(k, 0, length_index);
while( i < k ) {
int64_t k = 2 * index_position - start_index;
CLAMP(k, 0, length_index);
while( i < k ) {
- highsample = MAX(highsample, buffer[i]); ++i;
- lowsample = MIN(lowsample, buffer[i]); ++i;
+ float high = !rect_audio ? buffer[i] : fabsf(buffer[i]);
+ highsample = MAX(highsample, high); ++i;
+ float low = !rect_audio ? buffer[i] : fabsf(buffer[i]);
+ lowsample = MIN(lowsample, low); ++i;
- int y1 = (int)(center_pixel - highsample * zoom_y2);
- int y2 = (int)(center_pixel - lowsample * zoom_y2);
+ int y1 = (int)(center_pixel - highsample * zoom_y);
+ int y2 = (int)(center_pixel - lowsample * zoom_y);
CLAMP(y1, 0, max_y); int next_y1 = y1;
CLAMP(y2, 0, max_y); int next_y2 = y2;
//printf("draw_line (%f,%f) = %d,%d, %d,%d\n", lowsample, highsample, x2, y1, x2, y2);
CLAMP(y1, 0, max_y); int next_y1 = y1;
CLAMP(y2, 0, max_y); int next_y2 = y2;
//printf("draw_line (%f,%f) = %d,%d, %d,%d\n", lowsample, highsample, x2, y1, x2, y2);
// A different algorithm has to be used if it's 1 sample per pixel and the
// index is used. Now the min and max values are equal so we join the max samples.
if(mwindow->edl->local_session->zoom_sample == 1) {
// A different algorithm has to be used if it's 1 sample per pixel and the
// index is used. Now the min and max values are equal so we join the max samples.
if(mwindow->edl->local_session->zoom_sample == 1) {
- canvas->draw_line(x2 - 1, prev_y1, x2, y1, pixmap);
+ canvas->draw_bline(x2 - 1, !rect_audio ? prev_y1 : center_pixel, x2, y1, pixmap);
- canvas->draw_line(x2, y1, x2, y2, pixmap);
+ canvas->draw_bline(x2, y1, x2, !rect_audio ? y2 : center_pixel, pixmap);