INTERACT FORUM
Windows => Plug-in Development => Topic started by: nila on August 18, 2003, 12:28:45 pm
-
Hiya,
I wanna make a plugin but firstly have barely used VB ever before, secondly have no experience making plugins etc.
Was just wondering if someone could get me started.
When I chose new project in VB - - what type of project do I have to chose?
Also, how do I then start 'talking to' MC - any help would be LOVED :)
An example project with just the basic code to open up in MC functioning would be great - maybe just with with ONE example of reading a tree or something and putting the text into a text box?
I dunno - just a starting block so I can start fumbling on a bit :)
Thanks!
-
Hiya,
I wanna make a plugin but firstly have barely used VB ever before, secondly have no experience making plugins etc.
Was just wondering if someone could get me started.
When I chose new project in VB - - what type of project do I have to chose?
Also, how do I then start 'talking to' MC - any help would be LOVED :)
An example project with just the basic code to open up in MC functioning would be great - maybe just with with ONE example of reading a tree or something and putting the text into a text box?
I dunno - just a starting block so I can start fumbling on a bit :)
Thanks!
Download The Busy Box Sample
-
lol.
I knew someone would say that ;)
I already did - first thing - I compiled it and it made a .ocx - went to MC - add plugin - it wanted a dll so that obviously didn't work.
Also - the Busy Box is a workin little tool with a lot of code (not that much but enough to be confusing as to what is required to interact with MC and which parts are just to make it work).
-
Isn't there a .reg file that you have to merge to get it running?
-
Yeah I ran that :)
But if I go to MC/Plug-in Manager - add plugin - it's set to add .dll files not .ocx so I dont get it?
The example is a .ocx but MC wants a .dll?
Also - if I want to make a plugin - do I chose 'new dll' when it asks me what type of project I want to make?
If I chose new .dll and add it (and use the .reg file for MC) - will it instantly just work with nothing else needed?
Sorry for sounding dumb - this is just totally new terrortory - I'll pick it up fast :)
-
ok well i think thats because the reg file needs modified a bit to save to local mach and curent user.
i am not sure if they updated that to work with MC ie new registration key location.
but you should not need to add it.
sample:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\JRiver\Media Jukebox\Plugins\Interface\Party Sampler]
"IVersion"=dword:00000001
"Company"="SpartaSoft, Inc."
"Version"="0.0.01"
"URL"="http://www.spartasoft.com"
"Copyright"="Copyright (c) 2003, SpartaSoft, Inc."
"PluginMode"=dword:00000000
"ProdID"="PartySampler.PartySamplerCtrl"
[HKEY_LOCAL_MACHINE\Software\JRiver\Media Jukebox\Plugins\Interface\Party Sampler]
"IVersion"=dword:00000001
"Company"="SpartaSoft, Inc."
"Version"="0.0.01"
"URL"="http://www.spartasoft.com"
"Copyright"="Copyright (c) 2003, SpartaSoft, Inc."
"PluginMode"=dword:00000000
"ProdID"="PartySampler.PartySamplerCtrl"
i don't use the reg file to register the plug-in, but i have found that the above will fix what your seeing.
-
I'll try that.
And when I chose 'New Project' - (I'm using MS VB 6 Pro) - what type do I chose? Does it make a difference? I dont understand what difference chosing each type makes?
It doesn't seem to show any change in code no matter what type you chose so why does it let us chose a diff type?
-
I am in the same position as you Nila and any help would be appreciated. I tried compiling BusyBox but I have VS.NET 2k3 and it didn't seem to like it. I want to create a plugin similar to Kings Cover Art finder that can read all the files in playing now and can copy the cover art to the directory folder as a folder.jpg...would save me a lot of time trying to do it manually. Of course if King could add this to Cover Art Finder I wouldn't need to ;)
Adam
-
Yeah - the busy box isn't the best example for those with no experience.
I guess it's designed for those that already are fairly competant at VB.
I was playing a bit more with it and under 'project' at the bottom there seems to be some options where u can chose what type of file it is going to compile to under '[project name] properties' - so I think we can chose any project type.
Now I just have to get it working inside MC then I can start playing with the actual interacting with MC part.
This bit's probably gonna be the trickiest :)
But NoCode - AlbumView2 can do what your asking - it also finds cover art in the same folder as your songs. It has an option though to export the cover art to whever u want with whatever naming options u want.
Check it out - U get a demo of it and it's VERY well made :)
-
Also - I'm not sure if vs.net works - I think I remember King telling me to use vb6 - but I could be wrong - just giving a heads up - he'll confirm or deny the validity of that.
-
Also - I'm not sure if vs.net works
Matt (I think) Said It Works With VB Net
But Me And 5 Others Can't get It To Work With VB Net
They Also Have No Sample For VB .Net So When They Create One Then You Will Know When It Starts Working With VB.Net
====================================
Once You Get The Busy Box To Work Just Play With It A Bit.
J River I Am Sure Will Not Take The Time To Teach You How To Program But If You Run Into A Question There Are A Few Around That Might BeAble To Answer Your Questions
-
wahoo - got busy box working with a bit of help from Rhino - the: regsvr32 BusyBox.ocx
bit is what really threw me.
I couldn't work out how MC knew what to load up.
How do I find out what functions I can call MC with?
Like: MediaJukebox.MJCurPlaylistAutomation
There's a .tbl file but I cant work out what type of file it is - not sure if that contains the list of commands I can use.
?
-
Ok - I've realised I need to add the .tbl file to my project - cant work out what to do though to find the list of available commands :(
-
wahoo - worked that out too - I was expecting it to be part of the interface part of the page - didn't realise it was a seperate link on the page - sorry for seeming dumb!!
lol - tryin to learn 3 diff things at once here:
1. VB
2. Building a program that is a plugin (ie not stand alone with functions I've built)
3. Working out how to interact with MC
I'm getting it though!!
-
well at least you got it working.
>> didn't realise it was a seperate link on the page
that page is a bit out dated but maybe soon it will be updated.
-
Spoke too soon.
How are we meant to get picture Width and Height information from MC?
There's no reference to it on that page.
I did a search for 'width' too just in case I'd missed it and hadn't spotted it with no luck? :(
Also - I did this:
For z = 0 To MJCurPlaylist.GetNumberFiles - 1
' get the file
MJCurPlaylist.RemoveFile (z)
Next z
and it just seems to be removing a few items randomly each time - it should delete every single file in there shouldn't it? (I know there is a function to do that - I was just testing it and playing a bit)
(In case you didn't guess I'm hacking BusyBox and going to just delete everything I dont need and use that to make my plugin - I get an error saying: No public UserControl detected when I try to make my own :)
I hate learning new languages! :(
I'd just gotten fairly good at php too! :(
-
well maybe in the future.
all what is in there now is basicly MJ8 stuff
I have been sitting at the edge of my seat since march.
the seat is a bit warn on the right side, i am thinking about buying another, something with a High back and i can recline in it.
a pad for my foot rest (My woofer) might help
-
if i am not mistaken you might want to use "Step"
see the vb 6 help file for a sample
-
Great, so basically there is no way of dealing with the images inside of MC :(
Just what I didn't want to hear!
-
well work on the rest, maybe you can learn and when the MC9 sdk is out maybe what you want will be in it.
maybe
-
Also - I did this:
For z = 0 To MJCurPlaylist.GetNumberFiles - 1
' get the file
MJCurPlaylist.RemoveFile (z)
Next z
and it just seems to be removing a few items randomly each time - it should delete every single file in there shouldn't it? (I know there is a function to do that - I was just testing it and playing a bit)
That code only removes every other file. (item 1 becomes item 0 when you remove at 0)
When removing from an array, always FOR loop backwards so you don't have this problem. (z-1 to 0)
To get the width, do a File.Get("Width").
-
Wahey - Matt the great shows up.
Cheers Matt!!
I see what your saying - the index changes as we delete each file but my loop counter isn't.
I figured the index for each file would stay constant in the variable I'd set for it until I re-set it :)
-
Hmmm,
Still having some problems - haven't quite got to grips with how this works yet.
This isn't working:
For z = 0 To MJCurPlaylist.GetNumberFiles - 1
' get the file
Dim MJFile As MediaJukebox.MJFileAutomation
Set MJFile = MJCurPlaylist.GetFile(z)
' add the file width to the list
lbStatus.AddItem MJFile.Get("Width")
Next z
It's saying: Argument not optional when I try to compile it.
-
Ok - now all of a sudden that seems to be working?
I must be going nuts!
Thanks!!
-
Wahey - Matt the great shows up.
Cheers Matt!!
I see what your saying - the index changes as we delete each file but my loop counter isn't.
I figured the index for each file would stay constant in the variable I'd set for it until I re-set it :)
you could also just delete file "0" when the loop ends you should have an empty listbox
-
Yeah - I was more doing it just to play and get the hang of interacting with MC more - I'd have done RemoveAll to delete them all.
I'm getting the hang of it slowly.
Is there any way to get a list with ALL the field names and also the data type of each field name?
So I can work out which fields are list types etc?
This is comin along fairly easily. Hopefully I'll be able to make this plugin pretty fast.
-
Wwhen i get home i can give you something where you can use on all MC9 fields or user created fields (i don't have it in my head) but it is in the MC9 sdk.
you may need to look in mc9 edit fields for the names since some of them have been added.
-
Wahey - this is coming along nicely.
That'd be a BIG help king as I want to let people select what fields they want to use in the website.
This is coming along pretty fast.
I'm slowly slowly getting it :)
-
Note: Get Bios field
MyBios.Text = MJFile.Get("bios", False)
Note: Save Bios Field
Response = MJFile.Set("bios", MyBios.Text)
Note: Save Tags Now
Response = MJFile.SaveToTag()
Note: Clear Var
ArtistName = ""
But This Is faster
ArtistName = vbNullString
some of that In a ListBox
Private Sub List1_Click(Index As Integer)
ProgramStatus = "Waiting..."
DoEvents
' ********************************** '
' ********************************** '
' *** Get Info For Selected File *** '
' ********************************** '
' ********************************** '
On Error GoTo MyError
ArtistName = vbNullString
MyBios.Text = vbNullString
Dim MJCurPlaylist As MediaJukebox.MJCurPlaylistAutomation
Set MJCurPlaylist = g_MJ.GetCurPlaylist
Dim MJFile As MediaJukebox.MJFileAutomation
MyPosition = List1(0).ListIndex
Set MJFile = MJCurPlaylist.GetFile(MyPosition)
ArtistName = MJFile.Artist
MyBios.Text = MJFile.Get("bios", False)
DoEvents
If LenB(MyBios.Text) <> 0 Then
If Check1(9) Then
Call GetArtistBios_Click
End If
Else
Call GetArtistBios_Click
End If
MyError:
ProgramStatus = "Waiting..."
DoEvents
End Sub
-
Thanks :)
Do you know how I can get a list of ALL the fields though that are in the library?
I need to show the user a list of all the fields in it so he can select certain ones.
-
I don't think you can get a list.
-
darn darn darn!! :(
That's not gonna be good!
I'd have to make the users enter each field by hand that they wanted to use for the webpage :(
-
To get the width, do a File.Get("Width").
Matt,
Are you going to provide high speed access to common fields?
Calling File.Get("Width") is very inefficient since MC has to lookup by a string. Compounded with the fact that this may be called thousands of times, along with the corresponding Height, you can see the performance overhead is quite bad.
Why not introduce File.Get( <enum> ) so all MC has to do is a switch?
-
King - any idea how to create a colour picker in VB?
I want to let users select which colours to use from a palette - is there an object built into vb or do I have to create like a basic bunch of colour boxes for them to choose from?
-
is there an object built into vb or do I have to create like a basic bunch of colour boxes for them to choose from?
never looked, but in the vb help file it states there is a vb palette sample.
so if you installed VB with samples and help the samples should be there.
you can also do like i did and spend about $3,000 on VB6 books.
-
Nila,
VB does have a common control color picker. It is part of the windows common controls so should be accessible from the toolbox. If not make sure you have all the common controls selected.
Adam
-
yep
i went looking
here is a sample
Private Sub Command1_Click()
' Set Cancel to True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
'Set the Flags property
CommonDialog1.Flags = cdlCCRGBInit
' Display the Color Dialog box
CommonDialog1.ShowColor
' Set the form's background color to selected color
Form1.BackColor = CommonDialog1.Color
Exit Sub
ErrHandler:
' User pressed the Cancel button
End Sub
'Bang A Gong' Charted At 10 In 1972
Listening to: 'Bang A Gong' from 'The Best Of T. Rex' by 'T. Rex' on Media Center 9.1
-
Thanks for that - had the basic plugin working doing everything but am now going to tweak it to make it a lot more user configurable so they get LOTS of control over everything.
Still need to work out how to get a list of all the fields though so that the users can just select what fields they want to use.
Only other option is to make them have to manually type in each item - doesn't seem like too appealing a choice.
-
Still need to work out how to get a list of all the fields though so that the users can just select what fields they want to use.
you can include all the basic fields then add an option to include some of the user created ones.
-
Hey King - How do I check if a value is an INT?
I need to make sure a lot of user enterable fields are int's only and not anything else - tried looking it up and found (int) blah
but that doesn't seem to be working :(
Do you know how?
Thanks!
-
i do not understand your question
what is "INT"?
you may need to use a larger paragraph
-
Sorry dude :)
lol.
INT = Integer
I need to check a lot of the data to see if it's data type integer.
-
not sure what your trying to do and why so
there is allot of info in the VB help file about this.
-
by the way i found VB friend from
http://www.aivosto.com/products.html
to be a nice program to use to indent your code since for some reason VB6 does not do this it's self (not sure why, seems kind of dumb it not have an option for this).
but it has alot of other nice options
Project Analyzer from the same site works well (could work better) to speed your program up. it takes some use to get it to work but it has an auto fix mode, and some of the speed enhancements need manual fixing but it will recomend some things you can do.
-
King - what did you use in Chart Grabber to give you the table?
I want to use a table but dont know what control it is :(
-
I think the control you need is the MS Flexi grid. Works a bit like an excel spreadsheet allowing columns and rows to be resized...as for how to use it I have no idea :)
Adam
-
I think the control you need is the MS Flexi grid.
no but close
Private Sub UserControl_Initialize()
INIDIR = App.Path
Call Read_Registry
'! Variable written only: LHeader
Dim LHeader As Variant
' when the Form is loaded, the following code sets the '
' headers and width of the columns of the ListView control '
Set ListView1.Icons = ImageList1
Set LHeader = ListView1.ColumnHeaders.Add(1, , "Seq", 500)
Set LHeader = ListView1.ColumnHeaders.Add(2, , "Peek", 550)
Set LHeader = ListView1.ColumnHeaders.Add(3, , "Year", 550)
Set LHeader = ListView1.ColumnHeaders.Add(4, , "Song Name", 2725)
Set LHeader = ListView1.ColumnHeaders.Add(5, , "Artist Name", 2700)
Set LHeader = ListView1.ColumnHeaders.Add(6, , "From Chart", 1000)
ListView1.View = lvwReport
' SSTab1.Caption = "Chart Grabber, Ver: " & App.Major & "." & App.Minor & "." & App.Revision
End Sub