Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * This object is updated in this function, file: currenttime.c
- * GLOBALS->anno_ctx->marker
- *
- * Export this value into Linux userspace, there are many ways to do this.
- * Ideally, invoke export value mechanism inside of this function, so each time
- * marker is updated, the system variable gets updated as well.
- *
- * Needed for another project which would benefit from this feature.
- *
- * reformat_time(GLOBALS->anno_ctx->time_string, val + GLOBALS->global_time_offset, GLOBALS->time_dimension);
- *
- */
- void update_markertime(TimeType val)
- {
- #if !defined _MSC_VER
- if(GLOBALS->anno_ctx)
- {
- if(val >= 0)
- {
- GLOBALS->anno_ctx->marker_set = 0; /* avoid race on update */
- if(!GLOBALS->ae2_time_xlate)
- {
- GLOBALS->anno_ctx->marker = val / GLOBALS->time_scale;
- }
- else
- {
- int rvs_xlate = bsearch_aetinfo_timechain(val);
- GLOBALS->anno_ctx->marker = ((TimeType)rvs_xlate) + GLOBALS->ae2_start_cyc;
- }
- reformat_time(GLOBALS->anno_ctx->time_string, val + GLOBALS->global_time_offset, GLOBALS->time_dimension);
- GLOBALS->anno_ctx->marker_set = 1;
- }
- else
- {
- GLOBALS->anno_ctx->marker_set = 0;
- }
- }
- #endif
- if(!GLOBALS->use_maxtime_display)
- {
- if(val>=0)
- {
- if(GLOBALS->tims.baseline>=0)
- {
- val-=GLOBALS->tims.baseline; /* do delta instead */
- *GLOBALS->maxtext_currenttime_c_1='B';
- if(val>=0)
- {
- *(GLOBALS->maxtext_currenttime_c_1+1)='+';
- if(GLOBALS->use_frequency_delta)
- {
- reformat_time_as_frequency(GLOBALS->maxtext_currenttime_c_1+2, val, GLOBALS->time_dimension);
- }
- else
- {
- reformat_time(GLOBALS->maxtext_currenttime_c_1+2, val, GLOBALS->time_dimension);
- }
- }
- else
- {
- if(GLOBALS->use_frequency_delta)
- {
- reformat_time_as_frequency(GLOBALS->maxtext_currenttime_c_1+1, val, GLOBALS->time_dimension);
- }
- else
- {
- reformat_time(GLOBALS->maxtext_currenttime_c_1+1, val, GLOBALS->time_dimension);
- }
- }
- }
- else if(GLOBALS->tims.lmbcache>=0)
- {
- val-=GLOBALS->tims.lmbcache; /* do delta instead */
- if(GLOBALS->use_frequency_delta)
- {
- reformat_time_as_frequency(GLOBALS->maxtext_currenttime_c_1, val, GLOBALS->time_dimension);
- }
- else
- {
- if(val>=0)
- {
- *GLOBALS->maxtext_currenttime_c_1='+';
- reformat_time(GLOBALS->maxtext_currenttime_c_1+1, val, GLOBALS->time_dimension);
- }
- else
- {
- reformat_time(GLOBALS->maxtext_currenttime_c_1, val, GLOBALS->time_dimension);
- }
- }
- }
- else
- {
- reformat_time(GLOBALS->maxtext_currenttime_c_1, val + GLOBALS->global_time_offset, GLOBALS->time_dimension);
- }
- }
- else
- {
- sprintf(GLOBALS->maxtext_currenttime_c_1, "--");
- }
- gtk_label_set(GTK_LABEL(GLOBALS->maxtimewid_currenttime_c_1), GLOBALS->maxtext_currenttime_c_1);
- }
- if(GLOBALS->named_marker_lock_idx>-1)
- {
- if(GLOBALS->tims.marker >= 0)
- {
- int ent_idx = GLOBALS->named_marker_lock_idx;
- if(GLOBALS->named_markers[ent_idx] != GLOBALS->tims.marker)
- {
- GLOBALS->named_markers[ent_idx] = GLOBALS->tims.marker;
- wavearea_configure_event(GLOBALS->wavearea, NULL);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement