No announcement yet.

VB.Net FrontEnd with SourceCode (formerly VB6)

  • Filter
  • Time
  • Show
Clear All
new posts

  • VB.Net FrontEnd with SourceCode (formerly VB6)

    Here it is. It's all VB6. It's all written well. It's not bloated. I've been using it for over about 6 months, making minor tweaks.

    This time, I'm including the program, the source code, a skin, and a very basic "Getting Started" doc (now in HTML format) which explains how the INI file works.

    This program doesn't do TV, Radio, or OBD yet. I need to buy more hardware for those. OBD is next. Then HDTV. Then maybe radio. However, in the mean time, your current tuner program can be embedded and used.

    Hopefully, some people like the program. And, if not, maybe the sourcecode will be of use to some of you. I'm certainly not saying it's the best program out there, but if you're a coder, I think it's a great start.

    Here's the images of the program.

    The main interface

    Browse. Choose Media Type.

    The media browser. Choose horizontal or vertical split.

    Visualization / Album Art. In Video mode, the video is fullscreen.

    GPS info.

    Apps. Click an icon to launch the app and embed it into this program.

    This is MS Streets and Trips embedded.

    This is Solitaire embedded. Useful while waiting for a pizza.

    This is the Config window. The dimmer can be programmed, the unit of speed can be adjusted, and other stuff.

    And lastly, the Exit window.

    I will be keeping this program updated on my website, along with a change-log. and I'll try to keep it updated here, if there's any interest.

  • #2
    Sweet. I'll definatley have a look at this over the weekend and have a play.

    As I'm at work I can't open it up, but how does the skinning work? I see the images can be changed, but what about position etc? Are the x,y of the images currently set in the VB IDE?

    I can also suggest the OBDPros OBD interface. Very well priced and very reliable.
    I installed my carpc into my pet Kangaroo, mate.


    • #3
      I guess I shouldn't really call it skinning. It's just a folder full of images. The sizing and position is all relative to the screen size, so it scales to different resolutions pretty well. But the position is all through the VB IDE. There's probably enough free code provided to make it more truly "skinned" if someone wanted to.

      You just reminded me of something. There's some code in the DriveLine_Init function:
      If System_IsIDErunning() <> False Then    'Means VB is open, so we're probably testing
        frmMain.Width = 8460 * 2
        frmMain.Height = 4840 * 2
        frmMain.Left = (Screen.Width / 2) - (frmMain.Width / 2)
        frmMain.Top = (Screen.Height / 2) - (frmMain.Height / 2)
        frmMain.Width = Screen.Width
        frmMain.Height = Screen.Height
        frmMain.Left = 0
        frmMain.Top = 0
      End If
      This code controls how the program appears when you run it in the IDE. The hard-coded values (8460 and 4840) were just for testing the size of everything while I was using a 19" monitor, trying to simulate my 7" LCD.
      So, to anyone wanting to simulate their tiny screen while working on a big one, this block of code is the place to do it. Just tweak those two values until the window is the same visual size as your LCD.

      When you run the EXE, it runs full screen.


      • #4
        Functional FrontEnd with VB.Net 2005 SourceCode (attached)

        I decided that this deserved a reply instead of just an update to the original post.

        App supports:
        Media playback (music, video, images)
        Visualizations, album art
        GPS (with time-synchronizing)
        WiFi (for downloading weather/traffic alerts based on GPS position)
        Camera View
        OBD (ELM compatible)
        Hibernate / Resume (recommend devcon)
        Embedding programs
        Screen dimming (automatic and manual)
        Multiple skins. They're just images. Replace or modify as desired.

        App lacks:
        Volume Control
        Playlist builder / editor
        Voice Commands
        Tuner Control for Radio/TV cards

        All source code (including OBD) is provided. Now in VB.Net 2005.
        Updates: This site

        I use this front-end every day in my car. CPU usage is generally around 10%. Could be more now that OBD has been added.
        My CarPC: VIA 2GHz CPU, 1gig RAM, WindowsXP SP3.

        Main Window - click the status text to return to this screen.

        Browse Window - Choose: Music, Video, Images, Folder-Copier, or Alerts.

        Browse Music Window - Use tree to navigate, and click on list item to build/play playlist.

        Browse Alerts Window - Will list 'No Data' if unavailable.

        Viewing Alert - Traffic. By default it will list alerts within 30 miles of your GPS position.

        Viewing Alert - Weather.

        Image Slideshow Window

        Visualization Window - Music with Album Art. Click on album art to cycle through images.

        GPS Window - Showing basic info from GPS receiver

        GPS Window - Showing driving stats derived from GPS data.

        Apps Window - For embedding programs

        Ebedded App window - MS Streets & Trips 2006

        Ebedded App window - Solitaire (useful while waiting for food)

        Vehicle Window - This is the OBD information.

        Config Window - Basic settings.

        Exit Window - Close the program or Shut Down the PC.


        • #5
          Development History

          If OBD speed is being used, the Speed/Bearing will be underlined.

          The program will now prefer OBD-Speed (if available) over GPS-Speed if OBD data is less than 1 second old.
          Modified display text from "No GPS" to "No Speed" when neither GPS or OBD is present.

          Added support for embedding Apps which require the OBD port. Similar to the GPS.
          Added OBD support. Still testing.

          Fixed an issue with the dimmer not resetting when coming out of hibernate.
          Working on OBD.

          Fixed an issue with the conversion from GMT to local time, where the wrong time would be displayed if the input time seconds was between 59.5 and 59.9999. Obviously, a rounding error.

          Added seconds to the time display on the GPSinfo frame. It's normal for seconds to be skipped, which is probably why I chose to not display the seconds in the first place.
          Added support for version 3.0 of the NMEA sentence spec, and sentence $GPGLL.
          Removed all MSCOMM code. Replaced with Win32 FileAPI code to access COMM Port. So the MSCOMM COM Object is no longer required.
          Basically, there are 3 ways to access the COMM ports:
          1. Use the old MSCOMM object (a COM object). This is event-driven. I think I had issues getting this to work under Vista64.
          2. Use the Win32API and File functions. Setting this up to be event-driven is difficult, so it will be polling-based instead.
          3. Use the new System.IO.Ports.SerialPort class in Visual Studio 2005 and later. This is event-driven.
          Method # 3 is what I want to use, but the program will crash if a USB-Serial (most GPS and OBD) device is disconnected while running.
          So, method # 2 is what is now in place. The code for method # 3 is in place, but not used.

          Upgraded all code to VB.Net 2005. Option Explicit, Option Strict.
          Modified auto-updater to copy all files from source folder (EXE and DLLs).

          Removed the option for Horizontal Browser Split. Vertical is the way to go.
          Moved the RefreshInternet call into a separate timer.
          Corrected and clarified some code around the main timer and the interval.
          Added scrolling acceleration to the ListView (the bottom box of the Browser window).
          Reordered steps for setting current frame. Frames are now initialized before they are visible.

          Alerts now expire after 60 minutes.

          Fixed an error in the conversion from GMT date/time to local date/time.
          Fixed an error in the conversion of Longitude from DegsMinsSecs to Degs
          Added TimeStamps to Traffic Alerts.
          Alerts spanning multiple days now list the date-range.
          Alerts that expire today will list no date, only time-range.
          Added scrolling acceleration. The scroll-speed of the treeview doubles after 5 lines of scrolling.

          Decreased precision of Bearing. No more NNW, WNW, etc. Now just N, NW, W, SW, S, SE, E, NE.
          Modified the internet detection code. Now it queries a URL to confirm online status.
          Internet detection is refreshed every 30 seconds now (instead of every second).
          Tweaked the weather/traffic updates.

          Added Weather and Traffic alerts under the Media Browser.

          Fixed an issue with the SlideShow Browser, where clicking a folder in the Listview would cause an error if the folder contained no images.
          Added functionality to the visualization window. Clicking on album art will now iterate through all images in the current media directory.
          Added BMP and JPG code into generic CarPC module. Probably didn't need to at this point.

          Changed the album-art code to check for images containing the word "front" and if found, use that image first.

          Added 'Copy Folder' functionality under the Media Browser. Copy the folder and contents, or just the contents, to another folder.

          Modified the filename cleansing to also be able to remove repeated info from the end of filenames (album year, group names like h8me, whatever).

          Fixed an issue with the ShutDown procedure, which would crash the program instead of shutting down the PC.
          Tweaked the GPS Statistics code to compensate for hibernate/suspend.

          Changed the method of calculating average speeds.
          Changed the default unit within the program to KM. Using Knots was a pain for calculating averages.
          Fixed an issue with a date calculation function.
          Considering abandoning the GetTickCount function to avoid a potential overflow error after 49 days of not rebooting. Could be 25 days.

          Changed the GPS Info window to a 2-page interface. One with basic GPS data, and one with derived GPS statistics.
          GPS Stats Include: Avg Moving Speed, Avg Overall Speed, Time Moving, Time Stopped, Peak Speed, Trip Meter, and Launch.

          Modified the function that cleans up the filenames. Now, the underscore character is replaced with the space character.
          Also, the period character (except for the last one in the filename) is replaced with the space character.

          Fixed a minor issue with the ListView for the FileList, where a click in empty space (below the last item) was treated like a click on the selected item in the list.
          Adjusted the TreeView Text Truncation by a few pixels.
          Still considering removing the TreeView, and potentially trying to use a ListView in it's place.

          Fixed a type-o which would prevent the user from browsing for images for a slideshow.

          Code Clean-Up. Made a few functions faster.

          Fixed an issue where the visualization would remain full-screen after playing a video file, even if the next file was an audio file.
          Fixed the filename cleansing code to never remove all the characters from a file name.

          If two media paths overlap (ie C:\ and C:\Media) and the current media is located in both (ie C:\Media\MySong.MP3), the browser will now choose the longest media path that contains the media file as the root of the current media.
          This now works for playlists and images as well.
          Treeview Text Truncation now applies to playlists and root entries as well as subfolders.
          Fixed an error that would prevent media from being displayed in a root folder.

          Fixed minor issues with TreeView text truncation. This now seems to work perfectly.
          Fixed major issue where 2 media paths with the same root could not be specified. Paths now stored in TreeView Node.Tag instead of Node.Key.
          ListView still uses ListItem.Key for storing full path + filename.

          Modified the TreeView to check text width and ensure no item causes a Horizontal ScrollBar to appear.
          At present, this check is only performed for media files. Not for special entries, such as playlists.

          Fixed the code for the TreeView BackColor. Had to remove the tree-lines and the +button next to expandable nodes.
          Added functionality to remove repeated text from media file names (if text is in all visible filenames in directory).
          First it removes repeated text from the left. Then it breaks the filename into subfields, assuming a delimiter of "-" (hyphen), and checks for repeated values to remove.
          Then it does it all again, assuming a delimiter of " " (space char).

          Modified the Browser code so that the TreeView and ListView controls can now have their colors specified.
          The bright white treeview and listview were an eye-sore at night in the dark.

          Font sizes are now measured to one-tenth of a point, resulting in more accurate auto-sizing.
          All playlist files are now denoted with <LST: instead of separate identifiers for <M3U: and <PLS:.
          Cleaned up the code that links the treeview and listview in the Browser window.
          DVD Label is now displayed in the NavBar.

          Changed Browser window to use a ListView control instead of a ListBox.
          Modified Browser window so PlayList files will appear in the Treeview, and can be browsed just like a folder.
          Had to tweak the format of the .PlayList file, changed the delimiter to a pipe | character.

          Changed GPSinfo window to use a ListView control with 2 columns instead of a ListBox. The CommonControls library was already required for the TreeView in the Browser window.
          Changed GPSinfo window to display date and time on separate lines.
          Perfected BAT code for updater.

          TimeZone offset is now updated upon resuming from hibernate/suspend. Also, GPS last-sync-date is cleared upon resuming, to force a refresh.
          Modified the BAT code for the updater to specifically wait for the DriveLine ProcessID to terminate before trying to install the new version.

          Fixed an issue where the PC would resume from hibernation, but forget that the screen should be dimmed. The dimmer is now refreshed at time of resume. This appears to be a Windows issue.
          Finally made GPS reconnect after closing an embedded app that required the GPS and had to be force-terminated.
          Basically, after closing an embedded app, the program will attempt to reconnect to the GPS every 5 seconds for 30 seconds.
          Added UpdateScanner. This will search all drive letters (1 subfolder deep) for a new version when the program is executed, (or upon resuming from hibernation) and offer to install the new EXE.
          The purpose of the UpdateScanner is to be able to upgrade the program without a keyboard or mouse attached.

          Added clock-sync. Once per day or per reboot, the clock will sync with the GPS date/time.
          Clicking the GPSinfo list will now reset the last-synced date, forcing the program to re-sync date/time.
          Fixed minor issue with embedding programs, which would cause the current track to restart.

          Added support for playlist formats .M3U and .PLS. These are managed internally, and should NOT be specified in the INI file.

          Cleaned up the GettingStarted document. Coded HTML manually. Now using PNG images instead of JPG images. Smaller files, better quality.
          Changes to GPSinfo window.
          -Combined Latitude and Longitude onto one line.
          -If the GPS device is present but there is no Satelite-Fix, the GPS info will show blank values instead of default values, and OS time instead of GPS time.

          Modified the ONRESUME function to better handle resuming from hibernation. Media resumes as it should. GPS reconnects.
          Configuring the program ONRESUME settings to run DEVCON.EXE with the RESCAN parameter seems to work well for re-enabling USB devices on resume.

          Set the program to always remain ONTOP of other programs. Considering making this an option in the DriveLine.ini file.
          Adjusted GPS sensitivity for tripmeter.
          The program will now display GPS Date/Time as Local Date/Time, using the TimeZone setting in Windows.

          The "Getting Started" document is now provided as HTML, instead of a Word Doc. Smaller ZIP file, more compatibility.
          Adjusted the function that draws icons for the apps window. Now using the Image and ImageMask (DI_NORMAL instead of DI_IMAGE), the icons look better.
          Clicking the GPSinfo list will now reset the PeakSpeed and DistanceTraveled.
          Made it so more areas will hide the mouse if they are clicked (such as dead space, lists, etc).

          Fixed an issue where the peak speed would occasionally not get updated.
          Fixed an issue that would prevent the NavBar from hiding when playing DVD video.
          Fixed an issue that would prevent the program from resuming a playlist when the item in the playlist was a DVD video.
          Fixed an issue that would prevent the program from ejecting an optical disc.
          The program is now set up to gracefully handle ejecting the media that is currently playing.

          Added GPS-based tripmeter. Tried 2 different methods. By Lat/Lon, and by speed/time. Decided to go with speed/time method since it doesn't require trig.
          So far, I am very pleased with the accuracy of this.

          Finally made application embedding work reliably, with a new method for finding the main hWnd of a process.

          Clicking on the left half of the slideshow window will load the previous image.
          Clicking on the right half of the slideshow window will load the next image.
          Made it so more areas will hide the mouse if they are clicked (such as dead space, lists, etc).

          The slideshow image-list is now saved (and loaded on startup), just like the media playlist.

          Fixed an error in the image scaling routine, which would incorrectly re-calculate the aspect ratio of the image.
          Fixed an error that would crash the program if the Visualization window was loaded while no media was playing.

          Fixed an error that would display the wrong track number if the file chosen in the browser was not the first file in the folder.
          Fixed the way folders are handled in the treeview when they have no subfolders.
          Added new functionality - SlideShow. Modified interface to accomodate.
          New icons!

          When the browser window is loaded, the current track will be hilighted.

          Made the Up/Down arrows hide the mouse when clicked, just like the Prev/Next arrows.
          Added detection of suspend and resume. Upon resume, the program will execute a specified program. I don't know if this has a purpose or not -- I'm thinking devcon.

          Changed the way the program detects if an embedded program is idle.
          When a program is launched, it won't be embedded until CPU usage for that process drops below 4%.

          Changed the way the scrolling works on the Browser window. Now using SCROLL commands instead of ARROW commands, like I should have from the beginning.
          Changed the way the treeview handles clicks on the Browser window. More consistent now.
          Changed the layout of the NavBar to be 3 lines of text instead of 2, and locked the positions of text on the top line.

          Changed the format of the colors in the Skin.INI file to RGB format.
          Tweaked the embedding functions. Still not perfect.
          Changed the way album art is located. Now, the largest image in the folder (by filesize) is the one used.

          Embedded Programs nearly complete.
          Now supports:
          -Disable Playback while program is embedded (for running tuner programs, media players).
          -Disable GPS while program is embedded (for running mapping software).
          -Maximize program. This should almost always be set to TRUE.
          -CommandLine to include when running the program.
          -Commands to run after loading the program. An example for Streets & Trips: <SLEEP02><ALTDOWN>TGS<ALTUP><CTRLDOWN>A<CTRLUP><AL TDOWN>VNL<ALTUP><ALTDOWN>TGM<ALTUP>
          One problem at the moment. A program cannot be embedded if an instance of the program is already running.

          When a program is unembedded, a CLOSEWINDOW command is sent. If the window still exists after 5 seconds, the process is terminated.
          This works out well for programs that may prompt the user to save, or confirm something, such as Streets & Trips.

          Removed the Streets & Trips code. Replaced with a generic "Embedded Programs" interface. Up to 18 programs can be embedded.
          By default, the program icon is used, but a different image may be specified in the program INI file.
          Still working on all of this.

          Added album-art display in the Visualization window. Currently it checks for JPG and BMP images in the music folder.
          Tweaked the StatusText format. Removed Lat/Lon. Speed and bearing are now always displayed (if GPS is available).

          Fixed a bug that would cause an incorrect track number to be displayed when navigating past the end of a playlist.
          Enabled Hold-and-Scroll on the PREV and NEXT buttons, similar to the UP and DOWN arrows.
          Added an option to view the Browser window with a Vertical split, or with a Horizontal split.
          Changed the way the Browser window loads the current media path -- Now all folders get populated.

          Fixed a type-o, cleaned up the GettingStarted file. Made all of the source code available.

          Clicking the PREV button when you are more than 5 seconds into a song will now restart the same song (like how most disc players work).

          Unit of Speed is now an option. Choose MPH, KM/H, or Knots.
          Configuration window implemented.
          The program now keeps track of your peak speed.

          Added "Launch" stats to GPS info. In other words, it displays your acceleration info (0 to 60 in 5.9 seconds, for example)

          Separated code into two modules - one generic for CarPC programming, and one specific to this particular program.

          Added network detection. The status text now indicates if the CarPC is online or not.

          Made skin folder configurable. Separated program settings and skin settings.
          Fixed a bug which prevented the playlist from repeating.

          Scrapped the original program. Wrote a new interface. Much cleaner, better code (might even make source code available).
          New images, new layout.
          Visualization no longer loads automatically.
          No more support for NumPad input. Sorry. Could add it again later. Or programmable key commands.
          Numerous things fixed or added.


          • #6
            If it sucks, let me know why. That way, I can try to make it not suck.

            If it doesn't suck, also let me know. If nobody's using it, I have no reason to continue to make the app and sourcecode updates available.


            • #7
              What is this in? (It seems like it was converted to .NET?) Is it C# or VB? I am currently in the process of making a new open source C# front end. I dont know if many other people will like it though, as it's not really made to be pretty or skinable, it's more designed for features and stuff that I want specifically. For example, one of the main points is it has a embedded mssql server for keeping track of all the music and playlists and stuff and has fast realtime search capabilities. Another feature I am planning is DVR like capability for the radio (after have a DVR on the TV it sucks not having it for the radio too, heh)

              Anyways I wouldn't mind having a look at your code for some ideas and things.
              Car: 2004 GTI VR6 24v Turbo 2.8L, GT35R, 630cc, Unitronic, Bosch 044, etc, etc..
              Main PC:i7 [email protected], 6GB DDR3, MSI X-58 Pro-E, Win 7 x64 RTM, Scythe Mugen2, 128GB G.Skill Falcon, 2x ATI4850 512MB Crossfire, Auzentech X-Fi Forte, Grado Labs SR-80


              • #8
                The code is in VB.Net 2005. It uses a lot of Win32API, and uses no external components except Windows Media Player. The code is a couple posts above. Right after all the pics.

                Thank you for the feedback. I appreciate the response. Maybe I do need to focus more on interface than functionality at this point.


                • #9
                  Updated Version

                  I've spent a few minutes looking at your source code and have been making improvments for you.

                  its been upgraded to the latest version of

                  i removed NO SPEED to a space.

                  and the clock wouldnt always display correctly so i fixed that.


                  • #10

                    We're going to have to coordinate better. I'm still making changes in the VB.Net 2005 version, and fixing the OBD and GPS code, while you're making changes to labels.

                    Also, I'm not a fan of the new time display. 4:45: pm looks weird. Let's try to discuss changes before implementing them. That way we won't get too many disjointed versions, and ultimately confusion. And, we want to coordinate posting of versions.


                    • #11
                      the time on my machine displaied it at HH:MM:SS
                      before i changed it it was HH:MMSS


                      • #12
                        Unless you're looking at the GPS window, it shouldn't show Seconds at all. If it does, then something isn't handling the time formatting correctly. For example, the time on the 'status bar' should look like: 4:32pm

                        I looked into it, and made a change that I think will fix the time display. Let me know if it works for you. If not, let's look into it further. It's probably something to do with internationalization.

                        I've updated the source on my end to VB.Net 2008 so we can stay in sync with that.

                        I updated the 'Latest Build' page with the new code.

                        I don't think we want to just show a blank for No Speed. I mean, most CarPCs will have GPS or OBD, so the program should know the speed. If it doesn't, it's almost like something is wrong (software or hardware). It's kind of a debug message I guess. So I'm still torn on this one.


                        • #13
                          no i was looking in the main window. which is why it was confusing me.


                          • #14
                            Looks promising, just tried it out, trying to get some things configured. Had to try out a fellow Michigander's software.

                            Thx for sharing
                            Build Things, it keeps your brain busy.

                            AutoPC v1 (Retired) - AutoPC v2 (in progress) -


                            • #15
                              Thanks for trying it out. Let me know how it goes.