Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 784383 | Differences between
and this patch

Collapse All | Expand All

(-)Ardour-6.6.0.orig/gtk2_ardour/midi_tracer.cc (-4 / +4 lines)
Lines 53-59 MidiTracer::MidiTracer () Link Here
53
	, autoscroll (true)
53
	, autoscroll (true)
54
	, show_hex (true)
54
	, show_hex (true)
55
	, show_delta_time (false)
55
	, show_delta_time (false)
56
	, _update_queued (0)
57
	, fifo (1024)
56
	, fifo (1024)
58
	, buffer_pool ("miditracer", buffer_size, 1024) // 1024 256 byte buffers
57
	, buffer_pool ("miditracer", buffer_size, 1024) // 1024 256 byte buffers
59
	, autoscroll_button (_("Auto-Scroll"))
58
	, autoscroll_button (_("Auto-Scroll"))
Lines 61-66 MidiTracer::MidiTracer () Link Here
61
	, collect_button (_("Enabled"))
60
	, collect_button (_("Enabled"))
62
	, delta_time_button (_("Delta times"))
61
	, delta_time_button (_("Delta times"))
63
{
62
{
63
	g_atomic_int_set (&_update_queued, 0);
64
64
	ARDOUR::AudioEngine::instance()->PortRegisteredOrUnregistered.connect
65
	ARDOUR::AudioEngine::instance()->PortRegisteredOrUnregistered.connect
65
		(_manager_connection, invalidator (*this), boost::bind (&MidiTracer::ports_changed, this), gui_context());
66
		(_manager_connection, invalidator (*this), boost::bind (&MidiTracer::ports_changed, this), gui_context());
66
67
Lines 407-415 MidiTracer::tracer (Parser&, byte* msg, Link Here
407
408
408
	fifo.write (&buf, 1);
409
	fifo.write (&buf, 1);
409
410
410
	if (g_atomic_int_get (const_cast<gint*> (&_update_queued)) == 0) {
411
	if (g_atomic_int_compare_and_exchange (&_update_queued, 0, 1)) {
411
		gui_context()->call_slot (invalidator (*this), boost::bind (&MidiTracer::update, this));
412
		gui_context()->call_slot (invalidator (*this), boost::bind (&MidiTracer::update, this));
412
		g_atomic_int_inc (const_cast<gint*> (&_update_queued));
413
	}
413
	}
414
}
414
}
415
415
Lines 417-423 void Link Here
417
MidiTracer::update ()
417
MidiTracer::update ()
418
{
418
{
419
	bool updated = false;
419
	bool updated = false;
420
	g_atomic_int_dec_and_test (const_cast<gint*> (&_update_queued));
420
	g_atomic_int_set (&_update_queued, 0);
421
421
422
	RefPtr<TextBuffer> buf (text.get_buffer());
422
	RefPtr<TextBuffer> buf (text.get_buffer());
423
423
(-)Ardour-6.6.0.orig/gtk2_ardour/midi_tracer.h (-1 / +3 lines)
Lines 34-39 Link Here
34
#include "pbd/signals.h"
34
#include "pbd/signals.h"
35
#include "pbd/ringbuffer.h"
35
#include "pbd/ringbuffer.h"
36
#include "pbd/pool.h"
36
#include "pbd/pool.h"
37
#include "pbd/g_atomic_compat.h"
38
37
#include "midi++/types.h"
39
#include "midi++/types.h"
38
#include "ardour_window.h"
40
#include "ardour_window.h"
39
41
Lines 68-74 private: Link Here
68
	 *  equal to 0 when an update is not queued.  May temporarily be negative if a
70
	 *  equal to 0 when an update is not queued.  May temporarily be negative if a
69
	 *  update is handled before it was noted that it had just been queued.
71
	 *  update is handled before it was noted that it had just been queued.
70
	 */
72
	 */
71
	volatile gint _update_queued;
73
	GATOMIC_QUAL gint _update_queued;
72
74
73
	PBD::RingBuffer<char *> fifo;
75
	PBD::RingBuffer<char *> fifo;
74
	Pool buffer_pool;
76
	Pool buffer_pool;
(-)Ardour-6.6.0.orig/gtk2_ardour/public_editor.cc (-1 / +1 lines)
Lines 33-40 sigc::signal<void> PublicEditor::DropDow Link Here
33
33
34
PublicEditor::PublicEditor (Gtk::Widget& content)
34
PublicEditor::PublicEditor (Gtk::Widget& content)
35
	: Tabbable (content, _("Editor"), X_("editor"))
35
	: Tabbable (content, _("Editor"), X_("editor"))
36
	, _suspend_route_redisplay_counter (0)
37
{
36
{
37
	g_atomic_int_set (&_suspend_route_redisplay_counter, 0);
38
}
38
}
39
39
40
PublicEditor::~PublicEditor()
40
PublicEditor::~PublicEditor()
(-)Ardour-6.6.0.orig/gtk2_ardour/public_editor.h (-2 / +4 lines)
Lines 44-49 Link Here
44
#include <sigc++/signal.h>
44
#include <sigc++/signal.h>
45
45
46
#include "pbd/statefuldestructible.h"
46
#include "pbd/statefuldestructible.h"
47
#include "pbd/g_atomic_compat.h"
47
48
48
#include "temporal/beats.h"
49
#include "temporal/beats.h"
49
50
Lines 523-535 protected: Link Here
523
	friend class DisplaySuspender;
524
	friend class DisplaySuspender;
524
	virtual void suspend_route_redisplay () = 0;
525
	virtual void suspend_route_redisplay () = 0;
525
	virtual void resume_route_redisplay () = 0;
526
	virtual void resume_route_redisplay () = 0;
526
	gint _suspend_route_redisplay_counter;
527
528
	GATOMIC_QUAL gint _suspend_route_redisplay_counter;
527
};
529
};
528
530
529
class DisplaySuspender {
531
class DisplaySuspender {
530
	public:
532
	public:
531
		DisplaySuspender() {
533
		DisplaySuspender() {
532
			if (g_atomic_int_add(&PublicEditor::instance()._suspend_route_redisplay_counter, 1) == 0) {
534
			if (g_atomic_int_add (&PublicEditor::instance()._suspend_route_redisplay_counter, 1) == 0) {
533
				PublicEditor::instance().suspend_route_redisplay ();
535
				PublicEditor::instance().suspend_route_redisplay ();
534
			}
536
			}
535
		}
537
		}
(-)Ardour-6.6.0.orig/gtk2_ardour/timers.cc (-3 / +4 lines)
Lines 22-27 Link Here
22
#include "pbd/timer.h"
22
#include "pbd/timer.h"
23
#include "pbd/debug.h"
23
#include "pbd/debug.h"
24
#include "pbd/compose.h"
24
#include "pbd/compose.h"
25
#include "pbd/g_atomic_compat.h"
25
26
26
#include "debug.h"
27
#include "debug.h"
27
28
Lines 87-94 public: Link Here
87
		, rapid(100)
88
		, rapid(100)
88
		, super_rapid(40)
89
		, super_rapid(40)
89
		, fps(40)
90
		, fps(40)
90
		, _suspend_counter(0)
91
	{
91
	{
92
	g_atomic_int_set (&_suspend_counter, 0);
92
#ifndef NDEBUG
93
#ifndef NDEBUG
93
		second.connect (sigc::mem_fun (*this, &UITimers::on_second_timer));
94
		second.connect (sigc::mem_fun (*this, &UITimers::on_second_timer));
94
#endif
95
#endif
Lines 100-106 public: Link Here
100
	StandardTimer   super_rapid;
101
	StandardTimer   super_rapid;
101
	StandardTimer   fps;
102
	StandardTimer   fps;
102
103
103
	gint            _suspend_counter;
104
	GATOMIC_QUAL gint _suspend_counter;
104
105
105
#ifndef NDEBUG
106
#ifndef NDEBUG
106
	std::vector<uint64_t> rapid_eps_count;
107
	std::vector<uint64_t> rapid_eps_count;
Lines 212-218 fps_connect(const sigc::slot<void>& slot Link Here
212
213
213
TimerSuspender::TimerSuspender ()
214
TimerSuspender::TimerSuspender ()
214
{
215
{
215
	if (g_atomic_int_add(&get_timers()._suspend_counter, 1) == 0) {
216
	if (g_atomic_int_add (&get_timers()._suspend_counter, 1) == 0) {
216
		get_timers().rapid.suspend();
217
		get_timers().rapid.suspend();
217
		get_timers().super_rapid.suspend();
218
		get_timers().super_rapid.suspend();
218
		get_timers().fps.suspend();
219
		get_timers().fps.suspend();

Return to bug 784383