Author Topic: BASS.NET API 2.4.12.7  (Read 783652 times)

Ionut Cristea

  • Posts: 1545
Re: BASS.NET API 2.4.6.5
« Reply #775 on: 21 Jul '10 - 11:12 »
Quote
As Bass.Net doesn't implement a BASS_DSHOW_LoadPlugin2 method  - this couldn't be a bug ;-)
Bass.Net only implements one overload for it and that is:

void BASS_DSHOW_LoadPlugin(string plugin, Guid guid, string name)


So the native BASS_DSHOW_LoadPlugin2 function doesn't exist within Bass.Net!
The reason is, that the native BASS_DSHOW_LoadPlugin2 function is actually the unicode wrapper of BASS_DSHOW_LoadPlugin.
And as Bass.Net is always unicode I named the method BASS_DSHOW_LoadPlugin within Bass.Net - which in turns calls the native BASS_DSHOW_LoadPlugin2 function. That is also the reason why you are getting such an error ;-)

BASS_DSHOW_LoadPlugin2 is not a totally wrapper for unicode version of BASS_DSHOW_LoadPlugin function.
BASS_DSHOW_LoadPlugin2 clsid parameter is something like:
Quote
{00000000-0000-0000-0000-000000000000}
in BASS_DSHOW_LoadPlugin function clsid parameter is for example:
Quote
DEFINE_GUID(CLSID_DSHOWPLUGIN,
0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
and in the clsid parameter you'll pass the CLSID_DSHOWPLUGIN

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.5
« Reply #776 on: 21 Jul '10 - 12:08 »
@Sharky,

sorry I don't get this!

Here are the defines from the API:
a) void  BASSDEF(BASS_DSHOW_LoadPlugin)(PCHAR str,GUID guid,PCHAR name); 
b) void BASSDEF(BASS_DSHOW_LoadPlugin2)(void *file,void * guid,void *name,DWORD flags);

In your help file you say for BASS_DSHOW_LoadPlugin2: "Use this function to load a directshow filter/BASS_DSHOW filter. This function acts like a wrapper for BASS_DSHOW_LoadPlugin function".
However all parameters of BASS_DSHOW_LoadPlugin and BASS_DSHOW_LoadPlugin2 have exactly the same parameters and the parameter description is also 100% the same - except that BASS_DSHOW_LoadPlugin2 has one extra parameter where you can specify BASS_UNICODE.

So I must assume, that BASS_DSHOW_LoadPlugin and BASS_DSHOW_LoadPlugin2 are for the rest 100% identical?!

So do you say, that BASS_DSHOW_LoadPlugin2 expects a string value as the 'guid' parameter - whereas BASS_DSHOW_LoadPlugin expects a real GUID parameter?
If yes, please change your API/docs accordingly - so that anybody knows this.

Ionut Cristea

  • Posts: 1545
Re: BASS.NET API 2.4.6.5
« Reply #777 on: 21 Jul '10 - 15:18 »
Quote
So do you say, that BASS_DSHOW_LoadPlugin2 expects a string value as the 'guid' parameter - whereas BASS_DSHOW_LoadPlugin expects a real GUID parameter?
If yes, please change your API/docs accordingly - so that anybody knows this.

Yes...that i'm saying. I will fix the documentation for the next release.

muntablues

  • Posts: 196
Re: BASS.NET API 2.4.6.5
« Reply #778 on: 21 Jul '10 - 16:18 »
I use Bass.net 2.4.6.5 and if i call BassDShow.LoadMe() I get following message:

---------------------------
Incorrect BASS_DSHOW Version
---------------------------
An incorrect version of BASS_DSHOW was loaded!



Version loaded: 0.2

Version expected: 2.4



File: D:\Schule\T_INF\CSharp\BassVideo\BassVideo\bin\Debug\BASS_DSHOW.dll

FileVersion: 2, 4, 1, 0

Description: BASS_DSHOW - Video Support for BASS

Company: Cristea Aurel Ionut(www.suamp.hi2.ro) Copyright (C) 2010

Language: Englisch (Australien)
---------------------------
OK   
---------------------------

I have the lates BASS_DSHOW.dll in my debug folder, and its mentioned in this messagebox, so what is going wrong?

Thanks MB

Ionut Cristea

  • Posts: 1545
Re: BASS.NET API 2.4.6.5
« Reply #779 on: 21 Jul '10 - 16:19 »

muntablues

  • Posts: 196
Re: BASS.NET API 2.4.6.5
« Reply #780 on: 21 Jul '10 - 16:38 »
wow

faster than light *gg*

Works great now! TU!

MB

vasaka

  • Posts: 5
Re: BASS.NET API 2.4.6.5
« Reply #781 on: 30 Jul '10 - 13:43 »
Hello. Can someone tell me the difference between Bass(win32) shareware license and Bass.NET shareware license, if I want to sell my .NET program which using Bass.NET, what should I choose? I'm asking that because there are two dlls in my program folder, Bass.NET.dll and bass.dll.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.5
« Reply #782 on: 30 Jul '10 - 14:05 »
The BASS license is for the native BASS library.
The Bass.Net license is for the Bass.Net library.

In you case you would simply need for both products a license - meaning one for Bass and one for Bass.Net.

vasaka

  • Posts: 5
Re: BASS.NET API 2.4.6.5
« Reply #783 on: 2 Aug '10 - 10:52 »
So, I can't use Bass.NET in shareware products without purchasing bass.dll license?

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.5
« Reply #784 on: 2 Aug '10 - 14:44 »
You can.
But as soon as you are using any Bass function you of course also need a Bass license - yes.

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.5
« Reply #785 on: 3 Aug '10 - 13:45 »
Hi Bernd,

I can't get AlbumArt from ".m4a" files.

tagInfo.PictureCount give me 0 on all my ".m4a" files. The files have AlbumArt, (iTunes and WinAmp can show it).  ".m4a" comes from from iTunes Store (no DRM).

It works fine on ".mp3" files.  I use Bass.Net 2.4.6.5.  any suggestions?

/Ken

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.5
« Reply #786 on: 4 Aug '10 - 15:48 »
Bass.Net reads the TAG data (incl. pictures) through the provided BASS_ChannelGetTags functions.
Picture tags are therefore currently 'only' supported for ID3, APE, FLAC and WMA tags - but not for M4A.

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.5
« Reply #787 on: 4 Aug '10 - 16:17 »
Bass.Net reads the TAG data (incl. pictures) through the provided BASS_ChannelGetTags functions.
Picture tags are therefore currently 'only' supported for ID3, APE, FLAC and WMA tags - but not for M4A.

OK then I know, I did soled it with anoher tag reader.

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.5
« Reply #788 on: 4 Aug '10 - 16:50 »
Bernd,

I have new feature requests, all for the WaveForm class.

AddMarker.  I like two new overloads: "Color" and "NameDirection", so I can set separate color for each marker, and the last if the text shall shown left or right hand of the maker (usefull if a marker is at the very end of WF).

VolumeCurve, propertie for showing or not showing the "circles" on volumecurve (on the volumepoint)


And last a codeing question, wish is the best way to "find" a volume point when I use moseover on my WF image? I tested SearchVolumePoint, but I have to be very precise over the volumepoint. Maybe you have some C# code?

/Ken


riesm

  • Posts: 51
Re: BASS.NET API 2.4.6.5
« Reply #789 on: 4 Aug '10 - 19:15 »
Hi Bernd,

I second the feature request for text direction in the marker (to show it to the left side of the marker) for those markers that mark the end. The other requests are nice too of course :-)

Cheers,
riesm

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.5
« Reply #790 on: 4 Aug '10 - 20:12 »
Colored Markers are already supported today - see the AddMarker method.
You might specify an optional marker color by adding the following string to the end of the name: "{Color=colorname}" or "{Color=0xhexcolor}".
Example: "My Marker1{Color=Gray}" or "My Marker2{Color=0x78FF0000}"

Regarding its orientation: I might add a similar property to the marker name to support the position/orientation to a future release as well.

Here is a little helper class you might use to determine where/what you have 'clicked' with your mouse:
Code: [Select]
public class WaveFormHitTest
    {
        /// <summary>
        /// The position of the object.
        /// </summary>
        public long Position = -1L;
        /// <summary>
        /// The object type which was hit
        /// </summary>
        public WaveFormObjectType HitObjectType = WaveFormObjectType.LowerHalf;
        /// <summary>
        /// The object related to the type.
        /// </summary>
        public object HitObject = null;

        public long NewPosition = -1L;
        public object NewHitObject = null;

        public WaveFormHitTest()
        {
        }

        public override string ToString()
        {
            return String.Format("{0}, {1}, {2}", HitObjectType, HitObject, Position);
        }

        public static WaveFormHitTest HitTest(WaveForm waveForm, int frameStart, int frameEnd, int x, int y, int width, int height)
        {
            WaveFormHitTest hitTest = new WaveFormHitTest();

            if (frameEnd >= waveForm.Wave.data.Length)
                frameEnd = waveForm.Wave.data.Length - 1;
            if (frameEnd < 0)
                frameEnd = waveForm.Wave.data.Length - 1;
            if (frameStart < 0)
                frameStart = 0;

            hitTest.Position = hitTest.NewPosition = waveForm.GetBytePositionFromX(x, width, frameStart, frameEnd);
            if (y < height / 2)
                hitTest.HitObjectType = WaveFormObjectType.UpperHalf;

            int sourceX;
            int sourceY;
            long pos;
            long startPos = waveForm.Frame2Bytes(frameStart);
            long endPos = waveForm.Frame2Bytes(frameEnd);
            // bytes per pixel
            double bpp = (endPos - startPos) / (double)width;

            // first test markers
            if (waveForm.Wave.marker != null)
            {
                foreach (string markerName in waveForm.Wave.marker.Keys)
                {
                    pos = waveForm.Position2Playback(waveForm.Wave.marker[markerName]);
                    // check, if the marker fits into our display range (frameStart - frameEnd)
                    if (pos >= startPos && pos <= endPos)
                    {
                        // calculate the x pos of the marker
                        sourceX = (int)Math.Round((pos - startPos) / bpp);
                        // hit test!
                        if (x >= sourceX - 2 && x <= sourceX + 2 &&
                            y > (height / 2) && y < height - 5)
                        {
                            hitTest.HitObjectType = WaveFormObjectType.Marker;
                            hitTest.HitObject = hitTest.NewHitObject = markerName;
                            hitTest.Position = hitTest.NewPosition = pos;
                            break;
                        }
                    }
                }
            }

            // last test volume points
            int vpc = waveForm.GetVolumePointCount();
            int startIdx = waveForm.SearchVolumePoint(startPos);
            if (startIdx < 0)
                startIdx = ~startIdx;
            WaveForm.VolumePoint wfVP;
            for (int i = startIdx; i < vpc; i++)
            {
                wfVP = waveForm.GetVolumePoint(i);
                pos = wfVP.Position;
                // check, if the volPos fits into our display range (frameStart - frameEnd)
                if (pos >= startPos && pos <= endPos)
                {
                    // calculate the x pos of this volume point
                    sourceX = (int)Math.Round((pos - startPos) / bpp);
                    // calculate the y pos of this volume point
                    sourceY = (height - 1) - (int)Math.Round((height - 1) * wfVP.Level);
                    // hit test!
                    if (x >= sourceX - 2 && x <= sourceX + 2 &&
                        y >= sourceY - 2 && y <= sourceY + 2)
                    {
                        hitTest.HitObjectType = WaveFormObjectType.VolumePoint;
                        hitTest.HitObject = hitTest.NewHitObject = wfVP.Level;
                        hitTest.Position = hitTest.NewPosition = wfVP.Position;
                        break;
                    }
                }
                else if (pos > endPos)
                {
                    break;
                }
            }

            return hitTest;
        }

        public enum WaveFormObjectType
        {
            LowerHalf,
            UpperHalf,
            Marker,
            VolumePoint
        }
    }
And this is how you might use it:
Code: [Select]
private void pictureBoxWaveForm_MouseDown(object sender, MouseEventArgs e)
{
    WaveFormHitTest _hitTest = WaveFormHitTest.HitTest(_waveForm, _zoomStart, _zoomEnd, e.X, e.Y, pictureBoxWaveForm.Width, pictureBoxWaveForm.Height);

    switch (_hitTest.HitObjectType)
    {
        case WaveFormHitTest.WaveFormObjectType.VolumePoint:
            ...
            break;
        case WaveFormHitTest.WaveFormObjectType.Marker:
            ...
            break;
        case WaveFormHitTest.WaveFormObjectType.LowerHalf:
            ...
            break;
        case WaveFormHitTest.WaveFormObjectType.UpperHalf:
            ...
            break;
    }
}

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.6
« Reply #791 on: 11 Aug '10 - 17:11 »
The new Bass.Net version (2.4.6.6) will now support WaveForm marker alignments.

You might specify an optional marker alignment by adding the following string to the end of the name: "{Align=Left|Right|Center|Auto} (the default is Auto)."
Example: "My Marker1{Align=Center}", "My Marker2{Color=0x78FF0000}{Align=Right}"

The default alignment is "Auto", which means, that a marker is automatically right-aligned, if it exceeds the drawing width.
So I guess in most cases you won't even need to specify any alignment now ;-)

In addition volume point markers might be supressed by using the new NoPoints flaf in the "DrawVolume" (VOLUMEDRAWTYPE) property.
« Last Edit: 11 Aug '10 - 17:23 by radio42 »

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.6
« Reply #792 on: 11 Aug '10 - 17:22 »
11.08.2010: Version 2.4.6.6 is out!

Support for all latest BASS versions added
General:
  - BassTag: ID3v2.2 compatibility bug-fix
  - WaveForm: marker alignments added
  - WaveForm: New DrawVolume (VOLUMEDRAWTYPE.NoPoints) flag added to supress volume point markers

Full Install:
  www.un4seen.com/filez/4/Bass24.Net.zip

Lib only:
  www.un4seen.com/filez/4/Bass24.Net_update.zip

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.6
« Reply #793 on: 11 Aug '10 - 19:37 »
Thanks Bernd, beautiful work on the marker alignment!

toob

  • Posts: 133
BASS.NET and my first effect
« Reply #794 on: 17 Aug '10 - 15:19 »
Okay, I'm trying to apply my first effect (echo) to an existing mp3 steam which is playing.

I have the following sub but when it's called I hear no difference, what am I missing?

Public Sub Do_Effects()

        Dim echo As New Un4seen.Bass.BASS_DX8_ECHO()
        Dim fxHandle As Integer = Bass.BASS_ChannelSetFX(Stream, Un4seen.Bass.BASSFXType.BASS_FX_BFX_ECHO, 2)
        echo.fFeedback = 50.0
        echo.fWetDryMix = 50.0
        echo.lPanDelay = 0
        echo.fLeftDelay = 500.0
        echo.fRightDelay = 500.0
        Bass.BASS_FXSetParameters(fxHandle, echo)
 
    End Sub

I suspect it's something simple but after playing at it for over an hour I think I may need some help.

thanks in advance
Mark

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.6
« Reply #795 on: 18 Aug '10 - 05:39 »
Are you getting any error codes (see BASS_ErrorGetCode) in your code?

As the source looks quite okay to me.

(: JOBnik! :)

  • Posts: 1065
Re: BASS.NET API 2.4.6.6
« Reply #796 on: 18 Aug '10 - 10:21 »
Hi ;D

You're mixing two different effects BASS_DX8_ECHO with BASS_FX_BFX_ECHO ;)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.6
« Reply #797 on: 18 Aug '10 - 10:24 »
Uuups - yes indeed I have just overseen this one! ;-)

toob

  • Posts: 133
Re: BASS.NET API 2.4.6.6
« Reply #798 on: 18 Aug '10 - 15:42 »
Thanks guys, thought it was something simple, now working fine

Hi ;D

You're mixing two different effects BASS_DX8_ECHO with BASS_FX_BFX_ECHO ;)

toob

  • Posts: 133
Re: BASS.NET API 2.4.6.6
« Reply #799 on: 18 Aug '10 - 18:14 »
I want to make an "overloop" proceedure that will sample say half a second of a streamed mp3 when a user presses a button and then play the sample at the same time as the original stream, delayed. This would probably lead onto trying to sync the sampled data to the beat of the playing mp3.

Is this within the capabilities of bass.net or would I need to use one of the bass add-ons?
I've searched the forum and help files and it looks as if it should be possible but are unable to establish which commands to use to catch the sample. Would anyone be kind enough to post a small example or can point me in the right direction of how to grab a sample from a mp3 stream and play it delayed over the original, preferably in vb.

I see the steps required as:
1. make a copy of the playing mp3 stream for 500ms. Unsure how to do that.
2. use BASS_ChannelSetPosition to locate the chunk required
3. play the chunk

Probably not right but got to start somewhere...

thanks in advance
Mark