Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 49

Thread: OpenSource Object Pascal Module Playback Library

  1. #21

    OpenSource Object Pascal Module Playback Library

    What we want from our license seems to be all in MPL.

    Try reading the annotated version of it:
    http://www.mozilla.org/MPL/MPL-1.0-annotated-fs.html

    For using the mod library (code) in your own (commercial) program the annotation says:
    ``Distribution of Executable Versions''
    The goal of the NPL and the MozPL is to encourage as much innovation as possible. We anticipate that people will take the code licensed under the NPL and MozPL and combine it with code developed or licensed under other terms. We also anticipate that the combined code will be licensed under a variety of terms, including different payment terms, support terms and use restrictions. Netscape does not wish to dictate the terms under which any such executables will be available. The NPL and MozPL are designed to make sure that the Source Code Modifications are freely available. After that, the creator of a larger work is free to license the executable of the work as he or she sees fit.

    See the last sentence.
    But if you change something to the mod player you have to make it public. If you just use it as a part of another program it seems to be ok.

    Also in the beginning mpl states:
    The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
    Look at the word royalty-free.

    So it would be no problem to get the project at sf under mpl1.0 license.
    http://3das.noeska.com - create adventure games without programming

  2. #22
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenSource Object Pascal Module Playback Library

    I must be honest and tell you that I'm far from a wiz at these licences, but from what I see it look pretty muct like what we would want.

    So the gist of all this is;

    :arrow: If they make modifications to our code and use that code they must state so in their project somewhere.
    :arrow: They can use whatever binaries they make using our code under any licence they choose.

    :?: If they use our source or binaries(we do plan on making binary version of our libraries right?) in their project they have to give us credit

    Is this right? What other "rules" or terms can we tack onto it to make sure that we get what we want out of the MPL?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #23

    OpenSource Object Pascal Module Playback Library

    in short (as i read it):

    -anyone can use our mod player source in their (commercial) project if given proper credit. (also a link to the mod player source?)
    -if they change the source of the mod player the have to give us the changes they made to it.

    Read the mpl license for full details. As the above is very short.
    http://3das.noeska.com - create adventure games without programming

  4. #24

    OpenSource Object Pascal Module Playback Library

    [quote="noeska"]in short (as i read it):

    -anyone can use our mod player source in their (commercial) project if given proper credit. (also a ]

    That is how I understand it also.

    I have started some of the component structure and as soon as SF gets the page set up I'll get it put up there. Still have yet to hear from them... Guess I better go harass them and find out what the hold up is.... :?

    Anyways....

  5. #25

    OpenSource Object Pascal Module Playback Library

    I just found out there was a problem with the registration process I'm looking into it now and will let yall know what is wrong when I get some info from them.

    -Jeremy

  6. #26
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenSource Object Pascal Module Playback Library

    [quote="noeska"]in short (as i read it):

    -anyone can use our mod player source in their (commercial) project if given proper credit. (also a ]

    Looks good to me.


    Ok, well I've started to work on some loader code. You know, load_S3M, load_XM, load_IT functions. No point in making a load_MOD one since we can default to noeska's. Basically they load the whole header into a global variable of it's header type. That part is done along with a single simple validation function. As for loading patterns, orders, samples and instruments. I have yet to figure out the exact structure to use there. Samples should be rather easy though. The functions can moved into a TmodIT object for loading the header into it's self, etc.

    Here is a clip of my code so you guys can see what track I'm on. I can move this code into what ever template wilbur989 sets so that we stay on track with a single set of source code.

    [pascal]type
    MOD_Header = Record
    SongName : Array[1..20] of Char;
    Tag : Array[1..4] of Char;
    Channels : Integer;
    end;
    S3M_Header = Record
    SongName : Array[1..28] of Char;
    Unknown1 : Byte;{should be '1A' in hex}
    Typ : Byte;{File type: 16=module,17=song}
    Unknown2 : Word;{Unknown!}
    OrdNum : Word;{Number of orders in file}
    InsNum : Word;{Number of instruments in file}
    PatNum : Word;{Number of patterns in file}
    Flags : Word;
    TrackerVersion : Word;{Created with tracker / version}
    FileFormatVersion : Word;
    SCRM : Array[1..4] of Char;
    MasterVolume : Byte;{master volume}
    MasterMultiplier : Byte;{master multiplier (&15) + stereo(=+16)}
    InitialSpeed : Byte;{initial speed (command A)}
    InitialTemp : Byte;{initial tempo (command T)}
    Unknown3 : Array[1..12] of Byte;
    ChannelSettings : Array[1..32] of Byte;
    end;
    XM_Header = Record
    IDText : Array[1..17] of Char;
    SongName : Array[1..20] of Char;
    Unknown1 : Byte;{should be '1A' in hex}
    TrackerName : Array[1..20] of Char;
    VersionMajor : Byte;{hi-byte major and low-byte minor}
    VersionMinor : Byte;
    end;
    IT_Header = Record
    IMPM : Array[1..4] of Char;
    SongName : Array[1..26] of Char;
    PatternHilight : Word;{Useless for playback}
    OrderNumber : Word;
    InstrumentNumber : Word;
    SampleNumumber : Word;
    PatternNumber : Word;
    CreatedWith : Word;
    CompatableWith : Word;
    Flags : Word;
    Special : Word;
    GlobalVolume : Byte;
    MixingVolume : Byte;
    InitialSpeed : Byte;
    InitialTempo : Byte;
    PanningSeparation : Byte;
    PitchWheelDepth : Byte;
    MessageLength : Word;
    MessageOffset : DWord;
    end;

    const
    mtNon = 0;
    mtMOD = 1;
    mtS3M = 2;
    mtXM = 3;
    mtIT = 4;
    mtOther = 5;


    var
    {Module Header Info}
    ModuleType : Integer;
    MODTag : MOD_Header;
    S3MTag : S3M_Header;
    XMTag : XM_Header;
    ITTag : IT_Header;

    implementation


    function GetMODType(MODName: String): Integer;
    var MODStr : Array[1 .. 4] of Char;
    S3MType : S3M_Header;
    XMStr : Array[1 .. 17] of Char;
    ITStr : Array[1 .. 4] of Char;
    FileStream: File;
    begin
    if (not FileExist(MODName)) then
    begin
    Result := -1;
    Exit;
    end;

    AssignFile(FileStream, MODName);
    Reset(FileStream, 1);

    Seek(FileStream, 1080);
    BlockRead(FileStream, MODStr, SizeOf(MODStr));

    Seek(FileStream, 0);
    BlockRead(FileStream, S3MType, SizeOf(S3MType));

    Seek(FileStream, 0);
    BlockRead(FileStream, XMStr, SizeOf(XMStr));

    Seek(FileStream, 0);
    BlockRead(FileStream, ITStr, SizeOf(ITStr));

    CloseFile(FileStream);

    Result := mtOther;
    if (MODStr = 'M.K.') or (MODStr = '6CHN') or (MODStr = '8CHN') then
    Result := mtMOD;
    if (S3MType.SCRM = 'SCRM') then
    Result := mtS3M;
    if (XMStr = 'Extended Module: ') then
    Result := mtXM;
    if (ITStr = 'IMPM') then
    Result := mtIT;
    end;

    procedure Load_MODHeader;
    var FileStream : File;
    begin
    {Read Header From File}
    AssignFile(FileStream, SongFileName);
    Reset(FileStream, 1);

    BlockRead(FileStream, MODTag.SongName, SizeOf(MODTag.SongName));
    Seek(FileStream, 1080);
    BlockRead(FileStream, MODTag.Tag, SizeOf(MODTag.Tag));

    CloseFile(FileStream);

    {Display MOD Information}
    if (MODTag.Tag = 'M.K.') or
    (MODTag.Tag = '6CHN') or
    (MODTag.Tag = '8CHN') then
    begin
    {Display SongName}
    Main.SongTitle.Caption := MakeStr(MODTag.SongName);
    end;
    end;
    procedure Load_S3MHeader;
    var FileStreem : File;
    begin
    {Read Header From File}
    AssignFile(FileStreem, SongFileName);
    Reset(FileStreem, 1);

    BlockRead(FileStreem, S3MTag, SizeOf(S3MTag));

    CloseFile(FileStreem);

    {Display S3M Information}
    if (S3MTag.SCRM = 'SCRM') then
    begin
    {Display SongName}
    Main.SongTitle.Caption := MakeStr(S3MTag.SongName);
    end;
    end;
    procedure Load_XMHeader;
    var FileStreem : File;
    begin
    {Read Header From File}
    AssignFile(FileStreem, SongFileName);
    Reset(FileStreem, 1);

    BlockRead(FileStreem, XMTag, SizeOf(XMTag));

    CloseFile(FileStreem);

    {Display S3M Information}
    if (XMTag.IDText = 'Extended Module: ') then
    begin
    {Display SongName}
    Main.SongTitle.Caption := MakeStr(XMTag.SongName);
    end;
    end;
    procedure Load_ITHeader;
    var FileStreem : File;
    begin
    {Read Header From File}
    AssignFile(FileStreem, SongFileName);
    Reset(FileStreem, 1);

    BlockRead(FileStreem, ITTag, SizeOf(ITTag));

    CloseFile(FileStreem);

    {Display S3M Information}
    if (ITTag.IMPM = 'IMPM') then
    begin
    {Display SongName}
    Main.SongTitle.Caption := MakeStr(ITTag.SongName);
    end;
    end;
    [/pascal]

    Actually I lied. I did make a Load_MODHeader function, but it's only a part of my old code for my multi-format music player from a year or two ago. And it's not a very good one at that. :? It'll be replaced I'm sure.

    It's coming close to the date of my flight, I mgiht just send the code by email if the sourceforge isn't up soon.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  7. #27

    OpenSource Object Pascal Module Playback Library

    Quote Originally Posted by WILL
    I did make a Load_MODHeader function, but it's only a part of my old code for my multi-format music player from a year or two ago. And it's not a very good one at that. It'll be replaced I'm sure.

    It's coming close to the date of my flight, I mgiht just send the code by email if the sourceforge isn't up soon.
    Kool Looking good Now I'll Show you the component code that I have started thus far. Remember this is just the mod format so Chances are this is really subject to change. There is aslo alot of debug properties that will not be neede in the final version so if you see somthing either redundant or wierd that is probably why. Also I'm to the point of loading the sample data so it will probably have more code to it By the time SF has the project fixed. BTW at this point I dont expect to see that done till after Christmas. :-?

    -Jeremy

    [pascal]unit OpenModPlayer;

    interface

    uses
    SysUtils, Classes;

    type
    TSampHeader = Record
    Name: String[22];
    Length: Word;
    FineTune: ShortInt;
    Volume: Byte;
    LoopStart: Word;
    LoopLength: Word;
    End;

    TModHeader = Record
    Name: String[20];
    Verified: Boolean;
    Channels: ShortInt;
    SongLength: Byte;
    TotalPatterns: Byte;
    Order: Array [1..128] of Byte;
    SampleHead: Array [1..31] of TSampHeader;
    end;

    TOpenModPlayer = class(TComponent)
    private
    FDataStream: TFileStream;
    FHeader: TModHeader;
    FOpened: Boolean;
    // FVerified: Boolean;
    // FChannels: Integer;
    // FModName: String;
    procedure SetOpened(const Value: Boolean);
    procedure SetVerified(const Value: Boolean);
    Function Verify: String;
    procedure SetChannels(const Value: Integer);
    procedure SetModName(const Value: String);
    procedure Load;
    function GetChannels: Integer;
    function GetModName: String;
    function GetVerified: Boolean;
    function GetSample(Index: Integer): TSampHeader;
    procedure SetSample(Index: Integer; const Value: TSampHeader);
    protected
    { Protected declarations }
    public
    procedure Open(FileName: String);
    Property ModName: String read GetModName write SetModName;
    Property Channels: Integer read GetChannels write SetChannels;
    Property Verified: Boolean read GetVerified write SetVerified;
    Property Sample[Index:Integer]: TSampHeader read GetSample write SetSample;
    Property Opened: Boolean read FOpened write SetOpened;
    Property Header: TModHeader read FHeader;
    { Published declarations }
    end;

    procedure Register;

    implementation

    procedure Register;
    begin
    RegisterComponents('OpenMod', [TOpenModPlayer]);
    end;

    { TOpenModPlayer }

    function TOpenModPlayer.GetChannels: Integer;
    begin
    Result := FHeader.Channels;
    end;

    function TOpenModPlayer.GetModName: String;
    begin
    Result := FHeader.Name;
    end;

    function TOpenModPlayer.GetSample(Index: Integer): TSampHeader;
    begin
    Result := FHeader.SampleHead[Index];
    end;

    function TOpenModPlayer.GetVerified: Boolean;
    begin
    Result := FHeader.Verified;
    end;

    procedure TOpenModPlayer.Load;
    var
    I: Integer;
    TmpByte1, tmpByte2: Byte;

    begin
    //Load Modual Values
    FDataStream.Seek(0,0);
    FHeader.Name := StringOfChar(' ', 20);
    FDataStream.Read(FHeader.Name[1], 20);
    For I := 1 to 31 do
    begin
    FHeader.SampleHead[I].Name := StringOfChar(' ', 22);
    FDataStream.Read(FHeader.SampleHead[I].Name[1], 22);
    FDataStream.Read(tmpByte1, Sizeof(Byte));
    FDataStream.Read(tmpByte2, Sizeof(Byte));
    FHeader.SampleHead[I].Length := (tmpByte1 * $100 + tmpByte2) * 2;
    FDataStream.Read(tmpByte1, SizeOf(Byte));
    If tmpByte1 > 7 then
    FHeader.SampleHead[I].FineTune := tmpByte1 - 16
    Else
    FHeader.SampleHead[I].FineTune := tmpByte1;
    FDataStream.Read(FHeader.SampleHead[1].Volume, SizeOf(Byte));
    FDataStream.Read(tmpByte1, Sizeof(Byte));
    FDataStream.Read(tmpByte2, Sizeof(Byte));
    FHeader.SampleHead[I].LoopStart := (tmpByte1 * $100 + tmpByte2) * 2;
    FDataStream.Read(tmpByte1, Sizeof(Byte));
    FDataStream.Read(tmpByte2, Sizeof(Byte));
    FHeader.SampleHead[I].LoopLength := (tmpByte1 * $100 + tmpByte2) * 2;
    end;
    FDataStream.Read(FHeader.SongLength, SizeOf(Byte));
    FDataStream.Read(tmpByte1, SizeOf(Byte));
    FHeader.TotalPatterns := 0;
    For I := 1 to 128 do
    begin
    FDataStream.Read(FHeader.Order[I], SizeOf(Byte));
    If FHeader.Order[I] > FHeader.TotalPatterns then
    FHeader.TotalPatterns := FHeader.Order[I];
    end;
    end;

    procedure TOpenModPlayer.Open(FileName: String);
    Var
    Val: String;
    begin
    If Opened then
    begin
    FDataStream.Free;
    FDataStream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone);
    end
    Else
    begin
    FDataStream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone);
    FOpened := True;
    end;
    Val := Verify;
    If (Val = 'M.K.') then
    begin
    FHeader.Channels := 4;
    FHeader.Verified := True;
    Load;
    end
    Else
    if (Val = '6CHN') then
    begin
    FHeader.Channels := 6;
    FHeader.Verified := True;
    Load;
    end
    Else
    If (Val = '8CHN') Then
    begin
    FHeader.Channels := 8;
    FHeader.Verified := True;
    Load;
    end
    Else
    If (Val = '10CH') then
    begin
    FHeader.Channels := 10;
    FHeader.Verified := True;
    Load;
    end
    Else
    begin
    FHeader.Verified := False;
    FDataStream.Free;
    FOpened := False;
    end;
    end;

    procedure TOpenModPlayer.SetChannels(const Value: Integer);
    begin
    FHeader.Channels := Value;
    end;

    procedure TOpenModPlayer.SetModName(const Value: String);
    begin

    FHeader.Name := Value;
    end;

    procedure TOpenModPlayer.SetOpened(const Value: Boolean);
    begin
    FOpened := Value;
    end;

    procedure TOpenModPlayer.SetSample(Index: Integer;
    const Value: TSampHeader);
    begin

    end;

    procedure TOpenModPlayer.SetVerified(const Value: Boolean);
    begin
    FHeader.Verified := Value;
    end;

    function TOpenModPlayer.Verify: String;
    var
    tmpStr: String;

    begin
    If Opened then
    begin
    FDataStream.Seek(1080, soFromBeginning);
    tmpStr := StringOfChar(' ', 4);
    FDataStream.Read(tmpStr[1], 4);
    Result := tmpStr;
    end
    else
    Result := 'No File Open';
    end;

    end.[/pascal]

  8. #28
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenSource Object Pascal Module Playback Library

    Looks good so far. I still have to take a better look at her though. I just got home from work and am dreadfully tired.

    One quick point though; Shouldn't TOpenModPlayer be TOpenModMixer instead? being as Player implies that it will actually play it back, where as we are making this object our mixer? The difference from what I've always known was that a mixer is the section of code that renders all the sound and the player is the part that feeds it all to the soundcard. Just my 2 cents.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #29

    OpenSource Object Pascal Module Playback Library

    Quote Originally Posted by WILL
    One quick point though; Shouldn't TOpenModPlayer be TOpenModMixer instead?
    Yea I thought about that but for this first thing it acually will be a player. In the play area I just plan on handing the mixeed samples to PlaySound. Once I know that it works I'll start on making the sound interface for drivers.

    -Jeremy

  10. #30
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenSource Object Pascal Module Playback Library

    Well so long as we keep the mixer and player units seperate from each other, we won't run into problems when people will want to use the one, but not the other.

    With this we could make a playback component that uses OpenAL to playback using our OpenModMixer Unit, and if someone wanted to make a DirectX/DirectSound or DelphiX component they could do it themselves quite easily with just the OpenModMixer.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Page 3 of 5 FirstFirst 12345 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •