Browse Source

Make main tab vs browser use splitter (resizable); fix midifile

tags/1.9.4
falkTX 11 years ago
parent
commit
dedd3e61e1
5 changed files with 135 additions and 124 deletions
  1. +119
    -114
      resources/ui/carla.ui
  2. +1
    -1
      source/backend/CarlaNative.h
  3. +4
    -4
      source/backend/native/midi-file.cpp
  4. +1
    -1
      source/backend/plugin/NativePlugin.cpp
  5. +10
    -4
      source/carla.py

+ 119
- 114
resources/ui/carla.ui View File

@@ -14,8 +14,8 @@
<string>Carla</string> <string>Carla</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QFrame" name="frame_transport"> <widget class="QFrame" name="frame_transport">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin"> <property name="leftMargin">
@@ -140,109 +140,136 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" rowspan="2">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<widget class="QWidget" name="tab_plugins">
<attribute name="title">
<string>Plugins</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QWidget" name="w_plugins" native="true">
<layout class="QVBoxLayout" name="layout">
<property name="spacing">
<number>1</number>
<widget class="QTabWidget" name="tabMain">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_plugins">
<attribute name="title">
<string>Plugins</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QWidget" name="w_plugins" native="true">
<layout class="QVBoxLayout" name="layout">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property> </property>
<property name="margin">
<number>0</number>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>333</height>
</size>
</property> </property>
</layout>
</widget>
</item>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_patchbay">
<attribute name="title">
<string>Patchbay</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QTabWidget" name="tabUtils">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="sizeHint" stdset="0">
<property name="minimumSize">
<size> <size>
<width>20</width>
<height>333</height>
<width>210</width>
<height>0</height>
</size> </size>
</property> </property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_patchbay">
<attribute name="title">
<string>Patchbay</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
<property name="tabPosition">
<enum>QTabWidget::East</enum>
</property> </property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
<property name="currentIndex">
<number>0</number>
</property> </property>
<widget class="QWidget" name="disk">
<attribute name="title">
<string>Disk</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QTreeView" name="fileTreeView"/>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="1">
<widget class="QTabWidget" name="tabWidget_2">
<property name="minimumSize">
<size>
<width>210</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>210</width>
<height>16777215</height>
</size>
</property>
<property name="tabPosition">
<enum>QTabWidget::East</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="disk">
<attribute name="title">
<string>Disk</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item> <item>
<widget class="QTreeView" name="fileTreeView">
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
<widget class="CanvasPreviewFrame" name="miniCanvasPreview">
<property name="minimumSize">
<size>
<width>210</width>
<height>162</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>210</width>
<height>162</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property> </property>
</widget> </widget>
</item> </item>
@@ -250,28 +277,6 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="2" column="1">
<widget class="CanvasPreviewFrame" name="miniCanvasPreview">
<property name="minimumSize">
<size>
<width>210</width>
<height>162</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>210</width>
<height>162</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">


+ 1
- 1
source/backend/CarlaNative.h View File

@@ -218,7 +218,7 @@ void carla_register_native_plugin_audiofile();


#ifdef WANT_MIDIFILE #ifdef WANT_MIDIFILE
// MidiFile // MidiFile
void carla_register_native_plugin_midiFile();
void carla_register_native_plugin_midifile();
#endif #endif


#ifdef WANT_OPENGL #ifdef WANT_OPENGL


+ 4
- 4
source/backend/native/midi-file.cpp View File

@@ -216,7 +216,7 @@ private:


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


static const PluginDescriptor midiFileDesc = {
static const PluginDescriptor midifileDesc = {
/* category */ PLUGIN_CATEGORY_UTILITY, /* category */ PLUGIN_CATEGORY_UTILITY,
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI), /* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI),
/* audioIns */ 0, /* audioIns */ 0,
@@ -226,7 +226,7 @@ static const PluginDescriptor midiFileDesc = {
/* paramIns */ 0, /* paramIns */ 0,
/* paramOuts */ 0, /* paramOuts */ 0,
/* name */ "MIDI File", /* name */ "MIDI File",
/* label */ "midiFile",
/* label */ "midifile",
/* maker */ "falkTX", /* maker */ "falkTX",
/* copyright */ "GNU GPL v2+", /* copyright */ "GNU GPL v2+",
PluginDescriptorFILL(MidiFilePlugin) PluginDescriptorFILL(MidiFilePlugin)
@@ -234,9 +234,9 @@ static const PluginDescriptor midiFileDesc = {


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


void carla_register_native_plugin_midiFile()
void carla_register_native_plugin_midifile()
{ {
carla_register_native_plugin(&midiFileDesc);
carla_register_native_plugin(&midifileDesc);
} }


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------

+ 1
- 1
source/backend/plugin/NativePlugin.cpp View File

@@ -43,7 +43,7 @@ void carla_register_all_plugins()


#ifdef WANT_MIDIFILE #ifdef WANT_MIDIFILE
// MidiFile // MidiFile
carla_register_native_plugin_midiFile();
carla_register_native_plugin_midifile();
#endif #endif


#ifdef WANT_OPENGL #ifdef WANT_OPENGL


+ 10
- 4
source/carla.py View File

@@ -579,8 +579,8 @@ class CarlaMainW(QMainWindow):
self.ui.act_plugin_remove_all.setEnabled(False) self.ui.act_plugin_remove_all.setEnabled(False)


# FIXME: Qt4 needs this so it properly create & resize the canvas # FIXME: Qt4 needs this so it properly create & resize the canvas
self.ui.tabWidget.setCurrentIndex(1)
self.ui.tabWidget.setCurrentIndex(0)
self.ui.tabMain.setCurrentIndex(1)
self.ui.tabMain.setCurrentIndex(0)


# ------------------------------------------------------------- # -------------------------------------------------------------
# Set-up Canvas # Set-up Canvas
@@ -740,7 +740,7 @@ class CarlaMainW(QMainWindow):


elif extension in ("mid", "midi"): elif extension in ("mid", "midi"):
self.fLastLoadedPluginId = -2 self.fLastLoadedPluginId = -2
if Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, None, basename, "midifile", None):
if Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, None, basename, "midiFile", None):
while (self.fLastLoadedPluginId == -2): sleep(0.2) while (self.fLastLoadedPluginId == -2): sleep(0.2)
idx = self.fLastLoadedPluginId idx = self.fLastLoadedPluginId
self.fLastLoadedPluginId = -1 self.fLastLoadedPluginId = -1
@@ -1423,6 +1423,7 @@ class CarlaMainW(QMainWindow):
def saveSettings(self): def saveSettings(self):
settings = QSettings() settings = QSettings()
settings.setValue("Geometry", self.saveGeometry()) settings.setValue("Geometry", self.saveGeometry())
settings.setValue("SplitterState", self.ui.splitter.saveState())
settings.setValue("ShowToolbar", self.ui.toolBar.isVisible()) settings.setValue("ShowToolbar", self.ui.toolBar.isVisible())
#settings.setValue("ShowTransport", self.ui.frame_transport.isVisible()) #settings.setValue("ShowTransport", self.ui.frame_transport.isVisible())
settings.setValue("HorizontalScrollBarValue", self.ui.graphicsView.horizontalScrollBar().value()) settings.setValue("HorizontalScrollBarValue", self.ui.graphicsView.horizontalScrollBar().value())
@@ -1443,6 +1444,11 @@ class CarlaMainW(QMainWindow):
#self.ui.frame_transport.setVisible(showTransport) #self.ui.frame_transport.setVisible(showTransport)
self.ui.frame_transport.setVisible(False) self.ui.frame_transport.setVisible(False)


if settings.contains("SplitterState"):
self.ui.splitter.restoreState(settings.value("SplitterState", ""))
else:
self.ui.splitter.setSizes([99999, 210])

self.fSavedSettings = { self.fSavedSettings = {
"Main/DefaultProjectFolder": settings.value("Main/DefaultProjectFolder", HOME, type=str), "Main/DefaultProjectFolder": settings.value("Main/DefaultProjectFolder", HOME, type=str),
"Main/RefreshInterval": settings.value("Main/RefreshInterval", 50, type=int), "Main/RefreshInterval": settings.value("Main/RefreshInterval", 50, type=int),
@@ -1484,7 +1490,7 @@ class CarlaMainW(QMainWindow):
os.environ["SFZ_PATH"] = splitter.join(Carla.SFZ_PATH) os.environ["SFZ_PATH"] = splitter.join(Carla.SFZ_PATH)


def resizeEvent(self, event): def resizeEvent(self, event):
if self.ui.tabWidget.currentIndex() == 0:
if self.ui.tabMain.currentIndex() == 0:
# Force update of 2nd tab # Force update of 2nd tab
width = self.ui.tab_plugins.width()-4 width = self.ui.tab_plugins.width()-4
height = self.ui.tab_plugins.height()-4 height = self.ui.tab_plugins.height()-4


Loading…
Cancel
Save