~ubuntu-branches/ubuntu/wily/ardour/wily

« back to all changes in this revision

Viewing changes to gtk2_ardour/io_selector.cc

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Knoth
  • Date: 2010-06-01 20:58:59 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100601205859-wusr00931ozs7k8j
Tags: 1:2.8.8-1
* Imported Upstream version 2.8.8
* Refresh ardour-x-change.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
735
735
 
736
736
        pack_start (latency_frame);
737
737
        pack_start (hbox);
738
 
 
 
738
        
 
739
        update_latency_display();
 
740
        
739
741
        latency_button.signal_toggled().connect (mem_fun (*this, &PortInsertUI::latency_button_toggled));
740
742
}
741
743
 
 
744
void
 
745
PortInsertUI::update_latency_display ()
 
746
{
 
747
        nframes_t sample_rate = input_selector.session.engine().frame_rate();
 
748
        if (sample_rate == 0) {
 
749
                latency_display.set_text (_("Disconnected from audio engine"));
 
750
        } else {
 
751
                char buf[64];
 
752
                snprintf (buf, sizeof (buf), "%10.3lf frames %10.3lf ms", (float)_pi->latency(), (float)_pi->latency() * 1000.0f/sample_rate);
 
753
                latency_display.set_text(buf);
 
754
        }
 
755
}
 
756
 
742
757
bool
743
758
PortInsertUI::check_latency_measurement ()
744
759
{
754
769
                mtdm->resolve ();
755
770
        }
756
771
 
757
 
        char buf[64];
 
772
        char buf[128];
758
773
        nframes_t sample_rate = input_selector.session.engine().frame_rate();
759
774
 
760
775
        if (sample_rate == 0) {
780
795
        if (solid) {
781
796
                _pi->set_measured_latency ((nframes_t) rint (mtdm->del()));
782
797
                strcat (buf, " (set)");
 
798
                latency_button.set_active (false);
783
799
        }
784
800
 
785
801
        latency_display.set_text (buf);