LSCP import patch rev2

View: New views
4 Messages — Rating Filter:   Alert me  

LSCP import patch rev2

by Vladimir Savic-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here we go again... Improved patch!

Still I need to figure out how to create new devices from lscp file
(similar to what importing .rg files does).

Feature request:
Bank manager sorting isn't that great now. Bank 10 doesn't come up after
Bank 1 in real world. Bank 2 does!


Vlada

Index: src/sound/LSCPPatchExtractor.h
===================================================================
--- src/sound/LSCPPatchExtractor.h (revision 11161)
+++ src/sound/LSCPPatchExtractor.h (working copy)
@@ -16,6 +16,8 @@
 #ifndef LSCPPATCHEXTRACTOR_H
 #define LSCPPATCHEXTRACTOR_H
 
+#include "misc/Strings.h"
+
 #include <QString>
 #include <QStringList>
 
Index: src/sound/LSCPPatchExtractor.cpp
===================================================================
--- src/sound/LSCPPatchExtractor.cpp (revision 11161)
+++ src/sound/LSCPPatchExtractor.cpp (working copy)
@@ -64,7 +64,7 @@
     
     unsigned int bank, program;
     std::string programName;
-    //    std::string deviceName;
+//    std::string deviceName;
     
     if (!lscpFile.open(QFile::ReadOnly)) {
         return device;
@@ -74,20 +74,25 @@
             currentLine = currentLine.simplified();
             
             if (!currentLine.isEmpty() && currentLine.startsWith("add", Qt::CaseInsensitive)) {
-                // Preparation for returning device's name - do nothing for now!
-
-                // splitLine = currentLine.split(QRegExp("\\s+"));
-                // deviceName = splitLine.at(2).latin1();
+// Preparation for returning device's name - do nothing for now!
+//
+//                splitLine = currentLine.split(QRegExp("\\s+"));
+//                deviceName = splitLine.at(2).latin1();
                 
             } else if (!currentLine.isEmpty() && currentLine.startsWith("map", Qt::CaseInsensitive)) {
 
                 unsigned int positionOfBankElement = 3; //position of element in QStringList if NON_MODAL element is absent
                 unsigned int positionOfProgramElement = 4; //similar to above
 
-                splitLine = currentLine.split(QRegExp("\\s+"));
-                std::cout << splitLine.size() << std::endl;
+                splitLine = splitQuotedString(currentLine);
+//                std::cout << splitLine.size() << std::endl;
+//                for (int i = 0; i < splitLine.size(); i++) {
+//                    std::cout << i << ": " << splitLine.at(i) << std::endl;
+//                }
 
                 if (splitLine.at(2) == "NON_MODAL") {
+//                  std::cout << " Ima non_modal" << std::endl;
+// Shifting position of elements if optional element is present
                     positionOfBankElement = 4;
                     positionOfProgramElement = 5;
                 }
@@ -96,8 +101,10 @@
                 program = splitLine.at(positionOfProgramElement).toInt();
                 
                 QString quotedName = splitLine.at(splitLine.size() - 1);
-                if (quotedName[0] != '\'') {
-                    quotedName = "Unnamed instrument";
+//                std::cout << splitLine.at(splitLine.size() - 1).latin1() << std::cout;
+// Chacking for another optional element. This one is even more strange - program name may be absent as well!
+                if (quotedName.isEmpty() || quotedName.contains("ON_DEMAND") || quotedName.contains("ON_DEMAND_HOLD") || quotedName.contains("PERSISTENT")) {
+                    programName = "Unnamed instrument";
                 } else {
                     programName = quotedName.latin1();
                 }

------------------------------------------------------------------------------
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

Re: LSCP import patch rev2

by Vladimir Savic-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bump.

Michael, is there a problem with this patch I'm not aware of, or it's
just being overseen?

Vlada

Vladimir Savic wrote:

> Here we go again... Improved patch!
>
> Still I need to figure out how to create new devices from lscp file
> (similar to what importing .rg files does).
>
> Feature request:
> Bank manager sorting isn't that great now. Bank 10 doesn't come up after
> Bank 1 in real world. Bank 2 does!
>
>
> Vlada
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: LSCP import patch rev2

by D. Michael McIntyre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 04 November 2009, Vladimir Savic wrote:

> Bump.
>
> Michael, is there a problem with this patch I'm not aware of, or it's
> just being overseen?

It's a good thing you gave it a bump.  This was supposed to be on my TODO
list, but it fell off.  No, it looks fine.  Sorry about that, Vlada.
--
D. Michael McIntyre

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: LSCP import patch rev2

by Vladimir Savic-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

D. Michael McIntyre wrote:
> On Wednesday 04 November 2009, Vladimir Savic wrote:
>
>> Bump.
>>
>> Michael, is there a problem with this patch I'm not aware of, or it's
>> just being overseen?
>
> It's a good thing you gave it a bump.  This was supposed to be on my TODO
> list, but it fell off.  No, it looks fine.  Sorry about that, Vlada.

Not a problem! ;)

BTW, I'm preparing other nice features too... You'll be informed on time!

Thank you Michael.

Vlada

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel