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 > StreetDeck > DigitalMods (Scripts / API)

Reply
 
Thread Tools Display Modes
Old 04-20-2006, 08:08 PM   #1
Raw Wave
 
god_of_cpu's Avatar
 
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
My Photos: (0)
Intro to building DigitalMods

DigitalMods(TM) are the way in which you can add additional functionality to StreetDeck. They are essentially a combination of visual basic script and skin files that compose kind of a sub-application in StreetDeck. They are very similar to Macros in Microsoft Office but instead of forms and scripts you have skins and scripts. DigitalMods can only be created in the StreetDeck development enviornment distributed with the application under StreetDeck | Tools | Development Enviornment. Scripts in DigitalMods can access the StreetDeck object model directly and respond to events from it.

Each DigitalMod is contained in its own project folder named after a GUID when it is created. Each DigitalMod project can contain multiple scripts. The scripts in each project can talk to StreetDeck and talk to each other, but cant talk to other projects. Additionally, there are 3 types of scripts that can be added to a script project, they are modules, overlays, and media managers, for a description of what these are just visit http://www.mp3car.com/vbulletin/showthread.php?t=67876 As of version 1.0.4.2 only modules are supported. Support for overlays will be added next and support for media managers the month after that.

Links

Creating your First DigitalMod Tutorial

Create a New Project
To start creating your own DigitalMod, startup the development enviornment, then goto New | Script Project. This will create a project that will contain all the scripts used to create the DigitalMod.

Fill in Project Properties
The project will be initially empty. The properties bar on the right will contain various descriptive elements about your DigitalMod including the author, name, description, etc. that you should fill in immediatly after creating your new project.

Create a new scripted module
Once the project is created, you can add a new new scripted module to it, by goto to File | New | Scripted Module. Enter a unique name for the mdoule and it will create a blank script and skin for you to which you can add code and controls to respectively.

Add a Control
Before adding a control, you should make sure the module you want to add them to is selected in the treeview at the left. Find your project under Scripted Projects, then find the scripted module you just created and select it or one of the controls under. Now at the bottom left there should be a tab that says toolbox, switch to it, and find the button control. Double click on the button item and it will create a new button in your module. Now switch to design mode by going to Panels | Design Mode click on the new button you just added in the application window and notice the properties window is populated with the properties of the button. You can change the caption or any other available property of the button here. If you double click on the button (In design mode only), it should automatically add an event that is triggered when the button is clicked. Fill in the OnMouseClick event with the following text
Code:
Function Button_OnMouseClick(x, y) Module.MsgBox "Hello World", X & ", " & Y End Function

Run the script
Goto "Script Project | Start Project", make sure you are out of design mode first, then click on the newly added button and a message box should pop up with the text "Hello World" and the coordinates where the button was clicked.

Adding other events
Stop the script via Script Project | Stop Project. Notice the two combo boxes above the script window. The left combo box contains the names of all objects accessible to the script. Every time you add a new control, it will appear in this combo box. The right combo box contains all the events that correspond to the events generated by the object in the left combo box. To respond to a new event, simply choose one from the right combo and the event definition will be added to the script. For example, select Module from the left combo, then select OnRender from the right combo. The OnRender event is called upwards of 15 times per second depending on the frame rate of the application and redraws all screen elements every time it is called. Only rendering calls and very quick function calls should be called in this event. The OnRender event lets you draw elements directly on a module using the module's drawing functions. To demonstrate this add the following code to the OnRender event.
Code:
Function Module_OnRender() module.RenderFilledRect app.GetSystemMetric(eSMAppWidth) / 2 - 100, 200, app.GetSystemMetric(eSMAppWidth) / 2 + 100, 400, RGB(255, 0, 0), .5 End Function

This will render a semi transparent red square at the horizontal center and y position 200 in the module. (NOTE: All coordinates in StreetDeck are in app coordinates eSMAppWidth (1024) and eSMAppHeight (768) meaning the coordinate 1024, 768 will always be at the bottom right of the screen regardless of the size of the actual window being rendered.).


Script Ideas
For an idea of what you can do with the different types of scripts here some ideas for some example projects, many of these will have multiple scripts and may not all be of scripts of the same type, (i.e. media managers, have overlays associated with them to display the play status, etc) but can more or less be categorized into the following list: You can implement any of the items in the module list right now with the 1.0.4.2 sdk, the others, not yet.


Module Only
===================================
Weather Module
Google POI module
3D Satellite Tracking status module


Overlay
===================================
GPS Tracking
An Offroad Navigation plugin
WebCam streaming
Speak different module names
Show speed at all times


Media Manager
===================================
Internet radio
Sirius Radio
iPod


Documentation for the StreetDeck Development Enviornment is still in development. To get started with making your own DigitalMods, you can startup the development enviornment and use the built-in intellisense and example projects.
__________________
StreetDeck.com Developer (I am Chuck)
Get StreetDeck at http://www.streetdeck.com

Last edited by god_of_cpu : 12-21-2006 at 01:41 PM.
god_of_cpu is offline   Reply With Quote
Sponsored Links
Old 09-24-2007, 01:11 PM   #2
FLAC
strohj's CarPC Specs
 
strohj's Avatar
 
Join Date: Aug 2004
Location: Pearland
Vehicle: 2004 VW R32 ... 2006 Jeep Commander
Posts: 1,344
My Photos: (0)
Are you going to post some examples of using overlays? and how to trigger them?
__________________
Pentium 4m 1.5GHz|MB896|Roadie Extreme|XM-Direct|Rikaline 6010|T-View 7"|Streetdeck|160gb Western Digital|1Gb DDR2-533 Ram
strohj 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

vB 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
Building a motorised screen without motors??? NiN^_^NiN LCD/Display 20 11-24-2006 06:28 AM
need some advice building a car PC! dsmstunna Newbie 3 01-23-2006 01:03 PM
Need help building VW Monsoon amp input kbyrd Car Audio 92 11-18-2005 11:36 AM
Help with building your own DC to DC Power Supply dindin Power Supplies 2 10-05-2005 12:45 AM
Video problems while building computer Maveric General MP3Car Discussion 18 09-24-2001 06:28 PM


All times are GMT -5. The time now is 08:39 AM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics