Am 13.12.2012 06:26, schrieb Tim E. Real:
> On December 12, 2012 10:04:06 AM Florian Jung wrote:
>> Hi Tim
>>
>> yeah, i think such an option would be helpful.
>>
>> be aware that FreeBSD offers ALSA headers and the ALSA libraries, you
>> just cannot use any function which wants to talk with the kernel part
>> (i.e., almost every function ;) )
> 
> Ah yes, we'll need either two cmake bool options or one enum option:
> 
> Since we are really talking about that DSSI-ALSA compatibility package,
>  something like either 
>       ENABLE_ALSA_FULL and ENABLE_ALSA_DSSI_COMPAT_ONLY,
>  or probably better, a single enum option 
>       ENABLE_ALSA {FULL, DSSI_COMPAT_ONLY}
> 
> Those are the cmake enable  options. Now for the app defines:
> 
> If we go with the second idea, we can still split the result 
>  into two separate config defines for the app, like:
>       ALSA_FULL_SUPPORT and ALSA_DSSI_COMPAT_ONLY
>  which the app can check via the generated config.h.
> 

what's the status :)? could someone please add that. ideally along with
fixing muse not searching libs and includes in /usr/local :)?



>>
>> But we can compile it, and if libALSA offers some helper functions, i
>> guess we can use them.
> 
> I'm thinking, just support DSSI only - that's what the compat package 
>  was intended for, let's not try to hack our way into making MusE 
>  produce ALSA hardware events and such...

true, we should not try to "emulate" alsa. but MusE seems to use the
ALSA structures for storing MIDI data. And IMHO, we don't need to change
this; we have the headers, and when dealing with OSS, we can just
translate the stuff into OSS's data structures.

alternatively and for the long time we could replace all occurrences of
alsa-specific structures by MusE-local structures. So that ONLY the ALSA
driver files actually depend on ALSA.

> 
>>
>> MIDI access in OSS seems to be very straightforward: you get a devnode
>> where raw midi comes out, or you write raw midi in (i haven't verified
>> that, just a result of quick googling).
> 
> So about the driver, wow that's brave but it's a cool idea. Go man!
> What about Jack delivering the midi?
> Ah... I see, you want to capitalize on our discussions about timers 
>  and note resolution :)

I'd be fine with JACK delivering the MIDI I think, but others might not
be ;)
And from what I've read, OSS MIDI is very simple (as simple as just
write your data to the device, not more), so why not implement it :)

> 
> Some hi-res timer must be available in BSD. Hard to believe no RTC. 
> Maybe it's disguised as something else? In modern Linux I think the 
>  RTC just operates the HPET, the kernel has a RTC_HPET_EMULATE 
>  or something like that. (And the HPET is accessible via ALSA.)
> 
>> Currently, i have roughly done this:
>> - comment out the whole rtctimer file, because there is no #include
>>   <linux/rtc.h>.
> 
> I guess we'll detect what OS on a per-file level, and allow rtc or not.
> I see no reason to detect OS in cmake /just/ to pass it on to the app.
> (* See below.)

Uh, why that? What about the following:
- detect the OS cia CMake
- make a fully virtual "interface" class Timer
- make a derived LinuxRTCTimer, LinuxAlsaTimer, FreeBSDWhateverTimer
  which implement this interface.
- in main.c, depending on #if LINUX or #if FREEBSD, set the global
  variable Timer* our_timer to a new LinuxRTCTimer() or new FreeBSDTimer

shouldn't that work as well? Or are the timers that different?


> 
>> - replace all #include "event.h" by "../event.h"
> 
> There's 49 usages. Surely at the very least, the ones in the top level 
>  muse2/muse directory are finding event.h ?

yea that's right. only those files in subdirectories fail to find the
correct event.h.

> The others may simply be a matter of telling cmake to include the muse
>  directory from whatever directory the usages happen to be in.

yes. and possibly a matter of telling it to search there BEFORE anywhere
else.

i recall that it has actually found an event.h, but a wrong one, OS
supplied.

can you please fix that, as i have no idea about CMake ;)?

> 
> Can you tell me any specific usages? Surely not all?
> 
>> - add an exp10 macro
> 
> What do you mean - if for floats there is exp10f. Both are in <math.h>

nope, FreeBSD (as a POSIX-conformant OS) has only exp and exp2.
exp10 and exp10f is a nonstandard GNU extension (read man exp10, under
"CONFORMING TO" it says "is a GNU extension" ;) )

So i guess we'd just offer a math.h ourselves, like the following:
#include <path/to/real/math/h>
#ifndef exp10
  #define exp10(x) pow(10,(x))
#endif




> 
> If for speed well we have fastlog functions in fastlog.h
> But unfortunately no fastexp.
> But these days I just use the math.h versions.
> Mostly for accuracy - lack of it was causing some problems in MusE, 
>  speed is not much of a problem today.
> 
>> - manually fix the CMake-generated files so that it links
>>   against libs in /usr/local/lib, 
> 
> Huh? If there is stuff in /usr/local/lib the build system is 
>  supposed to use it instead of the same stuff in /usr/lib. 
> Sounds like maybe you got ldconfig problems?
> Sometimes one must manually add /usr/local/lib to the 
>  /etc/ld.so.conf file. Sometimes one must manually type
>  ldconfig after building and installing some piece of software
>  which installs libraries.

nope, freebsd handles this correctly afaik.

> 
> 
>>   and does not use -ldl
> 
> For that we'll probably detect OS in top cmake file, and if 
>  BSD then no -ldl.

yup. please do that, again, to me CMake is a huge black box full of magic ;)


>  
>>
>> so, i got MusE compiling, but it won't start because of errors like
>> "can't init the midi alsa subsystem!"
> 
> Yeah really eh. So close yet so far...
> 
> Nuts and bolts:
> -----------------------
> 
> Ok So the fact you want to have a timer and OSS midi changes the 
>  whole ball-game. Completely.
> 
> I was aiming for complete removal of the midi thread and all timers.
> This is what Werner's muse_evolution did, pure Jack only.
> (By 'removal' I mean optionally configured out. Not deleted.)
> 
> But since you'll have an OSS midi subsystem and timer going, 
>  then this is a matter of KEEPING the midi thread and timer support 
>  code for your timer.

wait wait. so you really want to remove nonjack MIDI stuff? i thought
that was always what I wanted and you didn't want ;)?

> Well anyway, irrelevant. This won't be 'removal' now, just configured 
>  re-implementation. Right?

No no, if you deem it possible to remove/configure out the MIDI thread
stuff, then go ahead. That would make MusE also portable to systems with
only JACK (and no ALSA and OSS).

I'd still suggest to continue with removing all that MIDI thread stuff;
that would involve
1. MusE being Jack-only and
2. MusE being cleaner,
right?


Please continue with your efforts. As I understood this, there will be
still a low-latency ALSA MIDI subsystem, right? Just that we don't
*have* to use/compile it?
That's cool :)


> Great idea though. Dude, you're gonna rock BSD !

yay! :)

greetings
flo
Index: muse2/CMakeLists.txt
===================================================================
--- muse2/CMakeLists.txt	(Revision 1650)
+++ muse2/CMakeLists.txt	(Arbeitskopie)
@@ -36,6 +36,8 @@
         SET(LIB_SUFFIX "" CACHE STRING "Suffix for installed library path. Ex. 64 for lib64")
 endif (NOT DEFINED LIB_SUFFIX)
 
+message("  libdir is " ${LIB_SUFFIX})
+
 if (NOT DEFINED VST_HEADER_PATH)
         SET(VST_HEADER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/vestige" CACHE PATH "Path to vst header files (aeffectx.h). Default is ./vestige. See ENABLE_VST_VESTIGE.")
 endif (NOT DEFINED VST_HEADER_PATH)
@@ -189,6 +191,7 @@
 ##
 
 CHECK_INCLUDE_FILE(ladspa.h HAVE_LADSPA_H)
+SET(HAVE_LADSPA_H TRUE)
 if(NOT HAVE_LADSPA_H)
       message(FATAL_ERROR "** ERROR: header file ladspa.h is required, but was not found.")
 endif(NOT HAVE_LADSPA_H)
Index: muse2/muse/arranger/pcanvas.cpp
===================================================================
--- muse2/muse/arranger/pcanvas.cpp	(Revision 1650)
+++ muse2/muse/arranger/pcanvas.cpp	(Arbeitskopie)
@@ -64,6 +64,7 @@
 #include "widgets/pastedialog.h"
 
 #define ABS(x) (abs(x))
+#define exp10(__x__) (pow(10.0,(__x__)))
 
 #define EDITING_FINISHED_TIMEOUT 50 /* in milliseconds */
 
Index: muse2/muse/ctrl/ctrlcanvas.h
===================================================================
--- muse2/muse/ctrl/ctrlcanvas.h	(Revision 1650)
+++ muse2/muse/ctrl/ctrlcanvas.h	(Arbeitskopie)
@@ -30,7 +30,7 @@
 #include "view.h"
 #include "tools.h"
 #include "midictrl.h"
-#include "event.h"
+#include "../event.h"
 
 class QMouseEvent;
 class QEvent;
Index: muse2/muse/ctrl.cpp
===================================================================
--- muse2/muse/ctrl.cpp	(Revision 1650)
+++ muse2/muse/ctrl.cpp	(Arbeitskopie)
@@ -42,6 +42,8 @@
 
 namespace MusECore {
 
+#define exp10(__x__) (pow(10.0,(__x__)))
+
 void CtrlList::initColor(int i)
 {
   QColor collist[] = { Qt::red, Qt::yellow, Qt::blue , Qt::black, Qt::white, Qt::green };
Index: muse2/muse/ctrl.h
===================================================================
--- muse2/muse/ctrl.h	(Revision 1650)
+++ muse2/muse/ctrl.h	(Arbeitskopie)
@@ -31,8 +31,11 @@
 #include <list>
 #include <vector>
 #include <qcolor.h>
-#include <lo/lo_osc_types.h>
 
+#ifdef OSC_SUPPORT
+	#include <lo/lo_osc_types.h>
+#endif
+
 #define AC_PLUGIN_CTL_BASE         0x1000
 #define AC_PLUGIN_CTL_BASE_POW     12
 #define AC_PLUGIN_CTL_ID_MASK      0xFFF
Index: muse2/muse/driver/rtctimer.cpp
===================================================================
--- muse2/muse/driver/rtctimer.cpp	(Revision 1650)
+++ muse2/muse/driver/rtctimer.cpp	(Arbeitskopie)
@@ -1,3 +1,4 @@
+#if 0
 //=========================================================
 //  MusE
 //  Linux Music Editor
@@ -171,3 +172,5 @@
     }
 
 } // namespace MusECore
+
+#endif
Index: muse2/muse/driver/rtctimer.h
===================================================================
--- muse2/muse/driver/rtctimer.h	(Revision 1650)
+++ muse2/muse/driver/rtctimer.h	(Arbeitskopie)
@@ -1,3 +1,5 @@
+#if 0
+
 //=========================================================
 //  MusE
 //  Linux Music Editor
@@ -60,3 +62,5 @@
 } // namespace MusECore
 
 #endif //__RTCTIMER_H__
+
+#endif
Index: muse2/muse/liste/editevent.h
===================================================================
--- muse2/muse/liste/editevent.h	(Revision 1650)
+++ muse2/muse/liste/editevent.h	(Arbeitskopie)
@@ -26,7 +26,7 @@
 #include "ui_editnotedialogbase.h"
 #include "ui_editsysexdialogbase.h"
 #include "ui_editctrlbase.h"
-#include "event.h"
+#include "../event.h"
 
 class QDialog;
 class QLabel;
Index: muse2/muse/midiedit/dcanvas.cpp
===================================================================
--- muse2/muse/midiedit/dcanvas.cpp	(Revision 1650)
+++ muse2/muse/midiedit/dcanvas.cpp	(Arbeitskopie)
@@ -42,7 +42,7 @@
 #include "midieditor.h"
 #include "drumedit.h"
 #include "drummap.h"
-#include "event.h"
+#include "../event.h"
 #include "mpevent.h"
 #include "xml.h"
 #include "globals.h"
Index: muse2/muse/midiedit/ecanvas.cpp
===================================================================
--- muse2/muse/midiedit/ecanvas.cpp	(Revision 1650)
+++ muse2/muse/midiedit/ecanvas.cpp	(Arbeitskopie)
@@ -39,7 +39,7 @@
 #include "midieditor.h"
 #include "ecanvas.h"
 #include "song.h"
-#include "event.h"
+#include "../event.h"
 #include "shortcuts.h"
 #include "audio.h"
 #include "functions.h"
Index: muse2/muse/midiedit/pianoroll.h
===================================================================
--- muse2/muse/midiedit/pianoroll.h	(Revision 1650)
+++ muse2/muse/midiedit/pianoroll.h	(Arbeitskopie)
@@ -35,7 +35,7 @@
 #include "cobject.h"
 #include "midieditor.h"
 #include "tools.h"
-#include "event.h"
+#include "../event.h"
 #include "midictrl.h"
 
 class QAction;
Index: muse2/muse/midiedit/prcanvas.cpp
===================================================================
--- muse2/muse/midiedit/prcanvas.cpp	(Revision 1650)
+++ muse2/muse/midiedit/prcanvas.cpp	(Arbeitskopie)
@@ -42,7 +42,7 @@
 #include "xml.h"
 #include "prcanvas.h"
 #include "midiport.h"
-#include "event.h"
+#include "../event.h"
 #include "mpevent.h"
 #include "globals.h"
 #include "cmd.h"
Index: muse2/muse/midiseq.cpp
===================================================================
--- muse2/muse/midiseq.cpp	(Revision 1650)
+++ muse2/muse/midiseq.cpp	(Arbeitskopie)
@@ -320,14 +320,14 @@
     {
     int tmrFd;
     
-    printf("Trying RTC timer...\n");
+    /*printf("Trying RTC timer...\n");
     timer = new RtcTimer();
     tmrFd = timer->initTimer();
     if (tmrFd != -1) { // ok!
         printf("got timer = %d\n", tmrFd);
         return tmrFd;
     }
-    delete timer;
+    delete timer;*/
     
     printf("Trying ALSA timer...\n");
     timer = new AlsaTimer();
Index: muse2/muse/widgets/citem.h
===================================================================
--- muse2/muse/widgets/citem.h	(Revision 1650)
+++ muse2/muse/widgets/citem.h	(Arbeitskopie)
@@ -27,7 +27,7 @@
 #include <QPoint>
 #include <QRect>
 
-#include "event.h"
+#include "../event.h"
 
 namespace MusECore {
 class Part;
Index: muse2/muse/widgets/spinboxFP.cpp
===================================================================
--- muse2/muse/widgets/spinboxFP.cpp	(Revision 1650)
+++ muse2/muse/widgets/spinboxFP.cpp	(Arbeitskopie)
@@ -29,6 +29,8 @@
 
 #include "spinboxFP.h"
 
+#define exp10(__x__) (pow(10.0,(__x__)))
+
 namespace MusEGui {
 
 //---------------------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer

Reply via email to