The MP3car.com Store  

Welcome to the MP3Car.com forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Front Ends > No Longer Supported > NeoCar Media Center

Reply
 
Thread Tools Display Modes
Old 05-05-2005, 08:55 AM   #1
Maximum Bitrate
 
netsuo's Avatar
 
Join Date: Jan 2003
Location: Switzerland
Vehicle: Audi S3 ABT 250
Posts: 558
My Photos: (0)
Add a EJECT button with NCS !

After spaceman's question about eject cd button not found, i tried toi do it in neocarscript.

And it WORKS !

So, here's how to do it:

1. create a blank NCS using a text editor
2. copy/paste this code

Code:
'//////////////////////////////////////////////////////////////////////// ' EXAMPLE NEOCAR SCRIPT '//////////////////////////////////////////////////////////////////////// 'INFORMATIONS '///////////// NAME=Eject CD/DVD Script AUTHOR=netsuo DATE=2005.04.19 08:15:00 DESCRIPTION=Eject the CD/DVD Rom EXECUTE=FUNCTION:Eject DVD/CD-Rom '-> ' FUNCTION:XXX : XXX is your function's name. While setting this, never executed but added to the actions list. You can then access this function using buttons actions in skin.xml (Example: <ACTION>SCRIPTS_FUNCTION;your_function_name</ACTION>) ' NMC_START : executed while starting NMC, after loading skin and config ' NMC_CLOSE : executed while stopping NMC ' MODULE_START:XXX : executed on start of desired module (where XXX is one of the following: ALL/APPLICATIONS/VIDEO/AUDIO/PHOTOS/FILELIST/MAIN) ' MODULE_CLOSE:XXX : executed on start of desired module (where XXX is one of the following: ALL/APPLICATIONS/VIDEO/AUDIO/PHOTOS/FILELIST/MAIN) ' TRACK_START:XXX : executed when track starts playing (where XXX is one of the following: APPLICATIONS/VIDEO/AUDIO/PHOTOS) ' TRACK_END:XXX : excuted when track ends (where XXX is one of the following: APPLICATIONS/VIDEO/AUDIO) ' TIMER : executed in a timer with "100" msec interval '//////// ' IMPORTANT NOTE : you can combine EXECUTE events by adding a "|" seperator. Example: MODULE_CLOSE:AUDIO|MODULE_START:AUDIO 'START CUSTOM SCRIPT '/////////////////// '-> here between "START" and "END" you can enter any VBScript code. (see NCS reference for objects available) NCS_START 'Use WMP to eject CDRom Set oWMP = CreateObject("WMPlayer.OCX.7") Set colCDROMs = oWMP.cdromCollection if colCDROMs.Count >= 1 then For i = 0 to colCDROMs.Count - 1 colCDROMs.Item(i).Eject Next End If NCS_END

3. Copy the file in scripts folder
4. Open NPC and select the button you want to become "EJECT CD/DVD"
5. Dble-click on it
6. In actions list, select "SCRIPTS_FUNCTION"
7. Choose your function in the combobox
8. Save skin.
9. Run NMC, click on your button and... YEAH

Hope you like it, it shows the power of NCS
__________________
NS - neocar suite
-----------------
http://www.neocarmediacenter.com
netsuo is offline   Reply With Quote
Sponsored Links
Old 05-05-2005, 11:09 AM   #2
Raw Wave
 
RoyN's Avatar
 
Join Date: Sep 2004
Location: São Paulo, Brazil
Vehicle: 1999 Range Rover 4.6HSE
Posts: 3,534
My Photos: (0)
Cool, this will eject all drives on the machine tho! LOL!

You can probably adjust the

colCDROMs.Item(i).Eject

to

colCDROMs.Item(0).Eject or colCDROMs.Item(1).Eject

if you have multiple and only want to eject 1 at a time! but this is really cool!

Also, where do we find out the name to use in CreateObject for a particular OCX we use in VB? is it easy?
RoyN is offline   Reply With Quote
Old 06-08-2005, 08:20 AM   #3
Newbie
 
karifan's Avatar
 
Join Date: May 2005
Location: Germany
Vehicle: 96' Audi A4 Avant
Posts: 23
My Photos: (0)
only to the completeness..
just another example for an eject button, using invokeverbs.. like selecting a command from an item's shortcut menu...

Code:
NAME=Uni CD/DVD-Rom Script AUTHOR=karifan DATE=2005.06.08 12:15:00 DESCRIPTION=Do something with the CD/DVD-Rom EXECUTE=FUNCTION:Uni DVD/CD-Rom NCS_START Dim ShApp, CDex Set ShApp=CreateObject("Shell.Application") Set CDex=ShApp.NameSpace(17).ParseName( "E:\" ) CDex.InvokeVerb("E&ject") NCS_END

could be used for autoplay the CD:
CDex.InvokeVerb("Auto&Play")
or other verbs..

note: must be specified to the CD letter... e.g.. 'E:/'
and the invoked verbs are dependent on OS and language.

for example on a German WinXP its:
CDex.InvokeVerb("A&uswerfen")
karifan is offline   Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relocating computer power button King_Xerxes General Hardware Discussion 8 02-21-2007 09:15 PM
button repeating bug? scott_fx Centrafuse 3 02-23-2005 11:35 PM
Shuttle power button? mazda3uzr Power Supplies 2 02-06-2005 04:36 PM
PC power button problem BMp3W Power Supplies 4 10-12-2002 02:36 AM
internet button on my pc babas151 General Hardware Discussion 10 05-31-2002 02:41 PM


All times are GMT -5. The time now is 07:20 PM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics