23 May '13 - 20:50 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 2 3 [4] 5 6 ... 13
  Reply  |  Print  
Author Topic: BASS_SFX v2.4.2.1 for winamp, sonique, bassbox, & WMP visual plugin support!  (Read 92222 times)
RevG
Posts: 453


« Reply #60 on: 7 Apr '09 - 20:15 »
Reply with quoteQuote

Here is some code C# which is actually working fine here:
Thanks for your help.  This is how my code is, exactly (well, it is now, the code I put in above was my first effort but since have changed it all to just about exactly what you listed).  For some reason though the PluginRender() calls start failing 30-40 seconds in to playing the visual though, visual stops updating, and all subsequent calls to BASS_SFX_PluginRender() fail.  If I free that SFX handle, and create a new one, it works again, but for the same specified time.  I think it has something to do with timers elsewhere in our app, but bass_vis worked without issue before, so I'm just wondering what could actually cause PluginRender() to return false all of a sudden?
You are the one who handles BASS.NET?  Nice to meet ya', I'm Scott, I work for David and Flux Media...

Hi Scott,

I have been working on a .NET example using C#. It will be uploading it shortly. In the mean time here is some sample code that I have working that you could try out. It uses the picturebox control for all rendering  Cheesy

Edit:
I have uploaded a new package now complete with Visual Studio 2005 C# .NET example.  http://www.cubesol.com/Files/BASS_SFX.zip


[DllImport("bass.dll")]
        public static extern bool BASS_Init(int device, uint freq, uint flag, IntPtr hParent, uint GUID);

        [DllImport("bass.dll")]
        public static extern int BASS_StreamCreateFile(bool mem, [MarshalAs(UnmanagedType.LPWStr)] String str, long offset, long length, long flags);

        [DllImport("bass.dll")]
        public static extern uint BASS_ErrorGetCode();

        [DllImport("bass.dll")]
        public static extern bool BASS_Free();

        [DllImport("bass.dll")]
        public static extern bool BASS_StreamFree(int stream);

        [DllImport("bass.dll")]
        public static extern bool BASS_ChannelPlay(int stream, bool restart);

        [DllImport("bass.dll")]
        public static extern bool BASS_ChannelStop(int stream);

        [DllImport("bass_sfx.dll")]
        public static extern bool BASS_SFX_Init(IntPtr hInstance, IntPtr hWnd);

        [DllImport("bass_sfx.dll")]
        public static extern int BASS_SFX_PluginCreate(string file, int width, int height);

        [DllImport("bass_sfx.dll")]
        public static extern bool BASS_SFX_PluginStart(int handle);

        [DllImport("bass_sfx.dll")]
        public static extern bool BASS_SFX_PluginSetStream(int handle, int stream);

        [DllImport("bass_sfx.dll")]
        public static extern bool BASS_SFX_PluginRender(int handle, int hStream, IntPtr hDC);

        int hStream = 0;
        int BASS_UNICODE = -2147483648;

        int hSFX = 0;
        int hSFX2 = 0;
        int hSFX3 = 0;

        IntPtr hVisDC = IntPtr.Zero;
        IntPtr hVisDC2 = IntPtr.Zero;
        IntPtr hVisDC3 = IntPtr.Zero;
       
        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            hVisDC = m_oVisPanel.CreateGraphics().GetHdc();
            hVisDC2 = m_oVisPanel2.CreateGraphics().GetHdc();
            hVisDC3 = m_oVisPanel3.CreateGraphics().GetHdc();

            if (BASS_Init(-1, 44100, 0, this.Handle, 0))
            {
                BASS_SFX_Init(System.Diagnostics.Process.GetCurrentProcess().Handle, this.Handle);

                hStream = BASS_StreamCreateFile(false, "music\\Matrix.mp3", 0, 0, BASS_UNICODE);
                BASS_ChannelPlay(hStream, false);

                hSFX = BASS_SFX_PluginCreate("plugins\\sphere.svp", m_oVisPanel.Width, m_oVisPanel.Height); //sonique
                hSFX2 = BASS_SFX_PluginCreate("plugins\\blaze.dll", m_oVisPanel2.Width, m_oVisPanel2.Height); //windows media player
                hSFX3 = BASS_SFX_PluginCreate("BBPlugin\\oscillo.dll", m_oVisPanel3.Width, m_oVisPanel3.Height); //bassbox

                BASS_SFX_PluginStart(hSFX);
                BASS_SFX_PluginStart(hSFX2);
                BASS_SFX_PluginStart(hSFX3);
                timer1.Interval = 27;
                timer1.Enabled = true;
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (hSFX != -1)
                BASS_SFX_PluginRender(hSFX, hStream, hVisDC);
            if (hSFX2 != -1)
                BASS_SFX_PluginRender(hSFX2, hStream, hVisDC2);
            if (hSFX3 != -1)
                BASS_SFX_PluginRender(hSFX3, hStream, hVisDC3);
        }
« Last Edit: 7 Apr '09 - 20:34 by RevG » Logged
w3k
Posts: 62


« Reply #61 on: 8 Apr '09 - 06:57 »
Reply with quoteQuote

  BASS_SFX URL
  http://www.cubesol.com/Files/BASS_SFX.zip

Hi All,
   BASS_SFX Test for Delphi7 Cheesy

* BASS_SFX(Delphi7).rar (314.19 KB - downloaded 36 times.)
« Last Edit: 8 Apr '09 - 12:37 by w3k » Logged
RevG
Posts: 453


« Reply #62 on: 8 Apr '09 - 23:08 »
Reply with quoteQuote

  BASS_SFX URL
  http://www.cubesol.com/Files/BASS_SFX.zip

Hi All,
   BASS_SFX Test for Delphi7 Cheesy

Thank you so much for the Delphi source! I noticed that the sonique or bassbox plugins were not rendering on the paintbox controls. I got a copy of delphi and changed the source to use panel controls instead and now all works great. I hope you don't mind Smiley

Cheers,
Greg
Logged
w3k
Posts: 62


« Reply #63 on: 9 Apr '09 - 05:26 »
Reply with quoteQuote

If the DSP plug-ins to support BASS_SFX it perfect Grin
Logged
RevG
Posts: 453


« Reply #64 on: 9 Apr '09 - 17:55 »
Reply with quoteQuote

BASS_SFX now has example usage source code and header/include files for the following languages:

  • C/C++
  • MFC/C++
  • Delphi 7
  • Visual Studio .NET C#
  • Visual Studio .NET VB.NET
  • Visual Basic 6
  • PowerBasic 9

 Cheesy

Cheers,
Greg
Logged
firemen
Posts: 141


« Reply #65 on: 9 Apr '09 - 17:57 »
Reply with quoteQuote

it is very important!
Is there possibility at started plugin to specify the new sizes of height and width of destination window?


w3k
I copy your exe and dll in the folder of bin SFX

I can not understand, in your example works only blaze.
sphere.svp, oscillo.dll - black screen.

are there ideas?
Logged
RevG
Posts: 453


« Reply #66 on: 9 Apr '09 - 18:08 »
Reply with quoteQuote

it is very important!
Is there possibility at started plugin to specify the new sizes of height and width of destination window?


w3k
I copy your exe and dll in the folder of bin SFX

I can not understand, in your example works only blaze.
sphere.svp, oscillo.dll - black screen.

are there ideas?

Firemen,

I am working on a resize function as we speak. Expect it to be there later today or tomorrow Smiley

Download the BASS_SFX.zip project and use the Delphi sample that exists in there. I have slightly modified w3k's source code so that all the plugins now work correctly. You will see that it uses panels now instead of a paintbox for rendering Smiley

Cheers,
Greg
Logged
firemen
Posts: 141


« Reply #67 on: 9 Apr '09 - 19:18 »
Reply with quoteQuote

Thank you very much!

Excuse me, would not yet explain for what needed   BASS_SFX_PluginSetStream ?
Logged
RevG
Posts: 453


« Reply #68 on: 9 Apr '09 - 19:19 »
Reply with quoteQuote

Thank you very much!

Excuse me, would not yet explain for what needed   BASS_SFX_PluginSetStream ?


BASS_SFX_PluginSetStream  is only currently useful for winamp plugins since winamp visuals draw to their own window. Later I might just remove the need for passing the HSTREAM handle to the BASS_SFX_PluginRender call and use exclusively BASS_SFX_PluginSetStream for all visuals. <-- probably the better way to do things Smiley

Cheers,
Greg
« Last Edit: 9 Apr '09 - 19:22 by RevG » Logged
RevG
Posts: 453


« Reply #69 on: 9 Apr '09 - 23:42 »
Reply with quoteQuote

v2.4.1.4 released with new call
BASS_SFX_PluginResize

All documentation, headers/includes, and libraries for all languages updated Smiley


Cheers,
Greg
Logged
bits
Posts: 40


« Reply #70 on: 10 Apr '09 - 02:28 »
Reply with quoteQuote

RevG, I just updated our SVP renderer. In particular it was not allocating enough memory and therefore caused a handful visuals(Aorta, Spec N Hopp, Rabbit Hole 1.0 etc) to unreliably crash with access violations.
The change is regarding m_textureData.
Logged
RevG
Posts: 453


« Reply #71 on: 10 Apr '09 - 04:53 »
Reply with quoteQuote

RevG, I just updated our SVP renderer. In particular it was not allocating enough memory and therefore caused a handful visuals(Aorta, Spec N Hopp, Rabbit Hole 1.0 etc) to unreliably crash with access violations.
The change is regarding m_textureData.

Thank you very much for notifying me about the update.  Smiley

Cheers,
Greg
Logged
firemen
Posts: 141


« Reply #72 on: 10 Apr '09 - 10:49 »
Reply with quoteQuote

thank you, all works!

Yet it would be not bad to do:

BASS_SFX_PluginCreate(
   char* strPath,
   HWND hWnd,
   _rect TRect
);


BASS_SFX_PluginResize(
   HSFX handle,
   _rect TRect
);
 
 Wink
« Last Edit: 12 Apr '09 - 18:17 by firemen » Logged
Patrice Terrier
Posts: 89


« Reply #73 on: 11 Apr '09 - 15:32 »
Reply with quoteQuote

Greg,

I have downloaded your "ClubDj ProVJ", very impressive piece of work!
with a very nice skinned interface as i like them...

I have also checked the EXE demo provided with the BASS_SFX zip.
and i found very instructive to compare the size of the resulting EXE that are doing almost the same thing  Smiley

I think that the BASS_SFX's PowerBASIC interface could be posted on the José Roca's forum, either in the BassBox forum, or in the Header section forum.

PS: is it possible to get some insight on how you are doing the skinning of the scollbars?



Logged
RevG
Posts: 453


« Reply #74 on: 12 Apr '09 - 00:57 »
Reply with quoteQuote

Greg,

I have downloaded your "ClubDj ProVJ", very impressive piece of work!
with a very nice skinned interface as i like them...

I have also checked the EXE demo provided with the BASS_SFX zip.
and i found very instructive to compare the size of the resulting EXE that are doing almost the same thing  Smiley

I think that the BASS_SFX's PowerBASIC interface could be posted on the José Roca's forum, either in the BassBox forum, or in the Header section forum.

PS: is it possible to get some insight on how you are doing the skinning of the scollbars?

Hi Patrice!

Thank you for the kind words! It took me a very long time in order to build the "skin engine" for ProVJ. I am the one and only developer for all my dj software products so you can imagine what a struggle it was :p I am big believer in sharing knowledge so I can tell you that I gave up on "skinning the scrollbars" and decided to hide them and then create my own graphics that look like scrollbars which in turn send messages to the treectrl or listctrl for scrolling. This ended up working great, but it was a huge and complex task. It took me 6 months of part time work to perfect it.

Since it took me so long I decided to help others out and I have written an article on this http://www.codeproject.com/KB/list/skinlist.aspx. This article is old, not up to date, and the coding is bad and also in MFC, but it still is basically the same technique I use in ProVJ. I can send you the updated code for how to do all of this if you want, just PM me.  If you have any specific questions for me please don't hestitate to ask me via this forum or pm if you wish Smiley

Basically this is what I do
//first you must hide the scrollbars using the following code
InitializeFlatSB(m_hListWnd);
FlatSB_EnableScrollBar(m_hListWnd, SB_BOTH, ESB_DISABLE_BOTH);

//now that the scrollbars are hidden you need to create your own using
//graphics which is a whole other task

//once you have your own graphical scrollbars created you
//must now write functions to scroll the list programatically in
//response to user input on your custom made scrollbars

//I have not included the code to create the graphic scrollbars or the code to programmatically
//scroll the listctrl/treectrl because there is a ton of code for all that. If you would like the code
//for this PM me and I will send you the raw code.


As a side note I have wrapped up my skin engine into a dll which I plan to release for sale to developers. I only have to finish the documenation which is a huge task. I will notify everyone via the un4seen forums in case anyone is interested. The cool part about the dll skin engine is that it uses an xml file and tga/bmp file to create the skin with built in "on the fly" changing of skins and it internally uses 100% win32 API so it will work with almost any windows programming langugage. The only bad part is that it is almost only useful for new projects as you have to design your software with the use of the "skin engine" in mind since it has its own controls and API.

Also, regarding the different file sizes of the demos in BASS_SFX, I was actually look at this as well when I was making it. It was very interesting to see the different file sizes that each programming language produced! I will upload the powerbasic header to the bassbox forums today Cheesy

Cheers,
Greg
Logged
Patrice Terrier
Posts: 89


« Reply #75 on: 12 Apr '09 - 09:10 »
Reply with quoteQuote

Greg,

I uploaded the header to the José Roca's forum already there:
http://www.jose.it-berater.org/smfforum/index.php?topic=1993.msg9722;topicseen#msg9722

Quote
It was very interesting to see the different file sizes that each programming language produced!
While using different languages, including managed C#, i am always back to the core flat API as soon as i want to take control of everything, mostly because, like yourself, i have also designed my own skin engine.

Low level programming is the only way to create efficient code for that purpose. WinLIFT was my first skinengine (i wrote it in 1997). However since VISTA, i was forced to take another approach to design the interface of my new applications, to let them work together with DWM in full composited mode.

If you want to see what i come with, then give a look here
make sure also to look at the fantastic interface of "Panther" that is 100% OpenGL coding by Ryan Cross.

Note: My GDImage graphic library allows the mixing of GDI32, GDIPLUS and OpenGL altogether.
you can try one of my lattest demo showing this in context there
(you must have a graphic card that is 100% OpenGL 2.0+ compatible to run the Image3D demo)
(The .zsk file is the counterpart of your .xml file)

When you see the size and speed of the resulting EXE, then you can understand the supperiority of the old SDK programming style hover the current approach of managed code that requires the bloated DotNET runtime Wink

Logged
ramses
Posts: 83


« Reply #76 on: 12 Apr '09 - 23:26 »
Reply with quoteQuote

Hi,

Since the version 2.4 i have a problem with the render fonction (using OpenGL) for sonique plugin's (no problem with the old version version 3.0).

the image is jerked.

Did you have any idea of what happening ?

Regards,

Philippe

http://www.qpratools.com
Logged
bits
Posts: 40


« Reply #77 on: 13 Apr '09 - 00:49 »
Reply with quoteQuote

The OpenGL for Sonique visuals that is in bass-sfx 2.4 works by rendering the visual at 512*512 regardless of the window the visual will be shown in. Then OpenGL is used to stretch the image to fit the window which infact could be much smaller than 512*512, but helps when larger.
Sonique visuals are CPU intensive and 512*512 might be too much for the visual and your CPU to handle. 240*240 seems to run fine on most machines/visuals and also helps with some visuals that cant work any higher.
TODO: When the window is smaller it probably should render the visual smaller Smiley


What visual(s) are you using and what size window are you trying to display them in?

Also I have a list of visuals and some of their querks here:
http://wasteofcash.com/Tuniac/visissues.txt
« Last Edit: 13 Apr '09 - 01:02 by bits » Logged
ramses
Posts: 83


« Reply #78 on: 13 Apr '09 - 08:30 »
Reply with quoteQuote

Hi,

Thanks for anwser.

The window size is 320*240 but changing the size to 240*2400 or 512*512 doesn't change anything.

I'm running under VISTA Dual Core 2.13Ghz.

I try different visual plugins but i have always the same results:  jerked image.

Tornado.svp
corona.svp
MetreX.svp...

Regards,

Philippe

http://www.qpratools.com
Logged
POG-iMplayer
Posts: 15


« Reply #79 on: 13 Apr '09 - 17:29 »
Reply with quoteQuote

RevG the good fellow that you do such work, many including I are grateful to you.!!!  Grin
Logged
Pages: 1 2 3 [4] 5 6 ... 13
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines