I'm not in a position to try it out right now, but is this perhaps the
answer to the problems that Ilan was experiencing (discussed off-list)
with inserting audio files?
(Ilan, are you subscribed to the -bugs list?)
Chris
---------- Forwarded message ----------
From: <
emrum@...>
Date: Sun, Oct 18, 2009 at 7:21 PM
Subject: [Rosegarden-bugs] SF.net SVN: rosegarden:[11061]
trunk/rosegarden/src/gui
To:
rosegarden-bugs@...
Revision: 11061
http://rosegarden.svn.sourceforge.net/rosegarden/?rev=11061&view=revAuthor: emrum
Date: 2009-10-18 18:21:53 +0000 (Sun, 18 Oct 2009)
Log Message:
-----------
You can drop Audiofiles on the TrackEditor now, from AudioFileManager
and PlayList
Modified Paths:
--------------
trunk/rosegarden/src/gui/application/RosegardenMainViewWidget.cpp
trunk/rosegarden/src/gui/dialogs/AudioManagerDialog.cpp
trunk/rosegarden/src/gui/editors/segment/TrackEditor.cpp
trunk/rosegarden/src/gui/editors/segment/compositionview/CompositionModelImpl.cpp
Modified: trunk/rosegarden/src/gui/application/RosegardenMainViewWidget.cpp
===================================================================
--- trunk/rosegarden/src/gui/application/RosegardenMainViewWidget.cpp
2009-10-18 16:18:14 UTC (rev 11060)
+++ trunk/rosegarden/src/gui/application/RosegardenMainViewWidget.cpp
2009-10-18 18:21:53 UTC (rev 11061)
@@ -1614,7 +1614,7 @@
progressDlg.progressBar(), SLOT(setValue(int)));
connect(&aFM, SIGNAL(setOperationName(QString)),
&progressDlg, SLOT(slotSetOperationName(QString)));
- connect(&progressDlg, SIGNAL(cancelClicked()),
+ connect(&progressDlg, SIGNAL(canceled()),
&aFM, SLOT(slotStopImport()));
try {
@@ -1631,9 +1631,9 @@
return ;
}
- disconnect(&progressDlg, SIGNAL(cancelClicked()),
+ disconnect(&progressDlg, SIGNAL(canceled()),
&aFM, SLOT(slotStopImport()));
- connect(&progressDlg, SIGNAL(cancelClicked()),
+ connect(&progressDlg, SIGNAL(canceled()),
&aFM, SLOT(slotStopPreview()));
progressDlg.progressBar()->show();
progressDlg.slotSetOperationName(tr("Generating audio preview..."));
@@ -1648,7 +1648,7 @@
//return false;
}
- disconnect(&progressDlg, SIGNAL(cancelClicked()),
+ disconnect(&progressDlg, SIGNAL(canceled()),
&aFM, SLOT(slotStopPreview()));
// add the file at the sequencer
Modified: trunk/rosegarden/src/gui/dialogs/AudioManagerDialog.cpp
===================================================================
--- trunk/rosegarden/src/gui/dialogs/AudioManagerDialog.cpp
2009-10-18 16:18:14 UTC (rev 11060)
+++ trunk/rosegarden/src/gui/dialogs/AudioManagerDialog.cpp
2009-10-18 18:21:53 UTC (rev 11061)
@@ -58,6 +58,7 @@
#include <QFileDialog>
#include <QTreeWidget>
#include <QTreeWidgetItem>
+#include <QTreeWidgetItemIterator>
#include <QMessageBox>
#include <QAction>
#include <QByteArray>
@@ -1041,56 +1042,49 @@
const Segment *segment,
bool propagate)
{
- QTreeWidgetItem *it = m_fileList->itemAt(0,0); //firstChild();
- QTreeWidgetItem *chIt = 0;
- AudioListItem *aItem;
- int nn;
- while (it) {
- // If we're looking for a top level audio file
- if (segment == 0) {
- aItem = dynamic_cast<AudioListItem*>(it);
-
- if (aItem->getId() == id) {
- selectFileListItemNoSignal(it);
- return ;
- }
- } else // look for a child
- {
- if (it->childCount() > 0)
- //chIt = it->firstChild();
- //chIt = it->itemAt(0,0);
- chIt = it->child(0);
- nn = 0;
- while (chIt && (chIt->childCount() < nn)) {
- nn +=1;
- aItem = dynamic_cast<AudioListItem*>(chIt);
-
+ QTreeWidgetItem *it = 0; //m_fileList->topLevelItem(0);
+ AudioListItem *aItem = 0;
+ //int itCount = m_fileList->topLevelItemCount();
+
+ QTreeWidgetItemIterator twIt( m_fileList, QTreeWidgetItemIterator::All );
+
+ // note: this iterates over topLevelItems and childItems too.
+ // I hope that's what we want to do (?)
+ // otherwise re-code to iterate over topLevelItems only.
+
+ it = *twIt;
+ while( it ) {
+
+ if( ! it ){
+ RG_DEBUG "AudioManagerDialog::setSelected Error:
item is 0 " << endl;
+ continue;
+ }
+ aItem = dynamic_cast<AudioListItem*>( it );
+
if (aItem) {
- if (aItem->getId() == id && aItem->getSegment()
== segment) {
- selectFileListItemNoSignal(chIt);
-
+ if ((aItem->getId() == id)
+ && (aItem->getSegment() == segment))
+ {
+ selectFileListItemNoSignal( it );
// Only propagate to compositionview if asked to
if (propagate) {
SegmentSelection selection;
selection.insert(aItem->getSegment());
emit segmentsSelected(selection);
}
-
return ;
}
- }
- //chIt = chIt->nextSibling();
- //chIt = it->itemBelow(chIt);
- chIt = it->child(nn);
- }
- }
+
+ }// end if(aItem)
+
+ twIt++;
+ it = *twIt;
+
+ }// end while
+
+}// end setSelected()
- //it = it->nextSibling();
- chIt = m_fileList->itemBelow(chIt);
- }
-}
-
void
AudioManagerDialog::selectFileListItemNoSignal(QTreeWidgetItem* it)
{
Modified: trunk/rosegarden/src/gui/editors/segment/TrackEditor.cpp
===================================================================
--- trunk/rosegarden/src/gui/editors/segment/TrackEditor.cpp
2009-10-18 16:18:14 UTC (rev 11060)
+++ trunk/rosegarden/src/gui/editors/segment/TrackEditor.cpp
2009-10-18 18:21:53 UTC (rev 11061)
@@ -825,6 +825,8 @@
t << uri << "\n";
t << track->getId() << "\n";
t << time << "\n";
+
+ RG_DEBUG << "TrackEditor::dropEvent() audioText = \n
" << audioText << "\n";
emit droppedNewAudio(audioText);
}
Modified: trunk/rosegarden/src/gui/editors/segment/compositionview/CompositionModelImpl.cpp
===================================================================
--- trunk/rosegarden/src/gui/editors/segment/compositionview/CompositionModelImpl.cpp
2009-10-18 16:18:14 UTC (rev 11060)
+++ trunk/rosegarden/src/gui/editors/segment/compositionview/CompositionModelImpl.cpp
2009-10-18 18:21:53 UTC (rev 11061)
@@ -821,6 +821,10 @@
void CompositionModelImpl::setSelected(const Segment* segment, bool selected)
{
+ if( ! segment ){
+ RG_DEBUG << "WARNING : CompositionModelImpl::setSelected -
segment is NULL " << endl;
+ return;
+ }
RG_DEBUG << "CompositionModelImpl::setSelected " << segment << " -
" << selected << endl;
if (selected) {
if (!isSelected(segment))
This was sent by the SourceForge.net collaborative development
platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference_______________________________________________
Rosegarden-bugs mailing list
Rosegarden-bugs@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-bugs------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel