Hi,

Am Dienstag, 3. August 2010, um 14:59:05 schrieb Louigi Verona:
> As I pointed out a lot of times on this mailing list, while sometimes you
> indeed have difficulties dragging windows around because the top of the
> window which you can drag is out of reach, the biggest problem that borders
> on actual functionality is the ability to open several instruments at a
> time. Fixing this alone would be a much greater benefit then rearranging
> the way windows look and here's why:
First part is here: I attached a patch which makes LMMS just have one 
instrument window at all. Globally passing all key events over to that one 
window should be easy as well. Tell me, if you're interested ;-)

Toby
diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h
index 53177b1..f64fe83 100644
--- a/include/InstrumentTrack.h
+++ b/include/InstrumentTrack.h
@@ -334,10 +334,7 @@ public:
 		return castModel<InstrumentTrack>();
 	}
 
-	void setInstrumentTrackView( InstrumentTrackView * _tv )
-	{
-		m_itv = _tv;
-	}
+	void setInstrumentTrackView( InstrumentTrackView * _tv );
 
 	static void dragEnterEventGeneric( QDragEnterEvent * _dee );
 
diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp
index 42f84db..ed09a8d 100644
--- a/src/tracks/InstrumentTrack.cpp
+++ b/src/tracks/InstrumentTrack.cpp
@@ -967,6 +967,7 @@ InstrumentTrackView::~InstrumentTrackView()
 }
 
 
+#define ONE_INSTRUMENT_WINDOW
 
 
 // TODO: Add windows to free list on freeInstrumentTrackWindow. 
@@ -977,20 +978,25 @@ void InstrumentTrackView::freeInstrumentTrackWindow()
 	if( m_window != NULL )
 	{
 		m_lastPos = m_window->parentWidget()->pos();
+#ifndef ONE_INSTRUMENT_WINDOW
 		if( s_windows.count() < INSTRUMENT_WINDOW_CACHE_SIZE )
 		{
+#endif
 			model()->setHook( NULL );
+			m_window->setInstrumentTrackView( NULL );
 			m_window->parentWidget()->hide();
 			m_window->setModel(
 				engine::dummyTrackContainer()->
 						dummyInstrumentTrack() );
 			m_window->updateInstrumentView();
+#ifndef ONE_INSTRUMENT_WINDOW
 			s_windows.enqueue( m_window );
 		}
 		else
 		{
 			delete m_window;
 		}
+#endif
 		
 		m_window = NULL;
 	}
@@ -1024,14 +1030,22 @@ InstrumentTrackWindow * InstrumentTrackView::getInstrumentTrackWindow()
 		m_window->updateInstrumentView();
 		model()->setHook( m_window );
 
+#ifdef ONE_INSTRUMENT_WINDOW
+		s_windows.enqueue( m_window );
+#else
 		if( m_lastPos.x() > 0 || m_lastPos.y() > 0 )
 		{
 			m_window->parentWidget()->move( m_lastPos );
 		}
+#endif
 	}
 	else
 	{
 		m_window = new InstrumentTrackWindow( this );
+#ifdef ONE_INSTRUMENT_WINDOW
+		// first time, an InstrumentTrackWindow is opened
+		s_windows.enqueue( m_window );
+#endif
 	}
 		
 	return m_window;
@@ -1288,6 +1302,18 @@ InstrumentTrackWindow::~InstrumentTrackWindow()
 
 
 
+void InstrumentTrackWindow::setInstrumentTrackView( InstrumentTrackView * _tv )
+{
+	if( m_itv && _tv )
+	{
+		m_itv->m_tlb->setChecked( false );
+	}
+	m_itv = _tv;
+}
+
+
+
+
 void InstrumentTrackWindow::modelChanged()
 {
 	m_track = castModel<InstrumentTrack>();

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
LMMS-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Reply via email to