8 Replies - 2309 Views - Last Post: 16 December 2012 - 12:42 PM Rate Topic: -----

#1 zaind  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 10-December 12

How to double click mp3 and have my player play it?

Posted 10 December 2012 - 08:30 AM

Hi Everyone
So I am working on my vb.net project which is a music player.
Now I have created everything. All the forms, Controls and every related stuff.
The problem is that my form has a sort of welcome page and then a Button which opens file dialog and let the user select songs. The Ok button adds these songs to a listbox which sort of acts as a playlist. What I want to do is that if I open a music file directly from my desktop (or any other local storage drive). I want my code to automatically skip the welcome page, add these selected songs to listbox.

Help would really be appreciated.
Code Behind 'loadplay' button (Playlist Loader)

name of second form is player
and name of listbox is playlistfront


         If player.playlistfront.Items.Count = 0 Then
            player.importdiag.ShowDialog()

            player.Show()
            Me.Hide()


        Else : Me.Hide()
            player.Show()

            player.add.Visible = True
        End If
                                      


:D/>/>/>

This post has been edited by modi123_1: 15 December 2012 - 08:51 PM
Reason for edit:: made the title more descriptive.


Is This A Good Question/Topic? 0
  • +

Replies To: How to double click mp3 and have my player play it?

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5441
  • View blog
  • Posts: 11,674
  • Joined: 02-June 10

Re: How to double click mp3 and have my player play it?

Posted 10 December 2012 - 08:45 AM

There are more than 500,000 users on the DIC. Can you imagine if they all titled threads as "Help" ? Please use meaningful titles so the people with the most knowledge in your area are drawn to your question. This also helps people later using search engines to find the help they need.
===========================================

Quote

if I open a music file directly from my desktop

Are you saying you want to associate double-click on a music file with your application? Or are you drag-dropping the music files onto the icon for your application? What exactly do you mean by this part and how is it associating those files with your application?
Was This Post Helpful? 0
  • +
  • -

#3 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 433
  • View blog
  • Posts: 3,011
  • Joined: 12-January 10

Re: How to double click mp3 and have my player play it?

Posted 10 December 2012 - 09:42 AM

sounds liek he may want to have his program run on double click sort of liek when you open a png file and it opens with the default viewer.
Was This Post Helpful? 0
  • +
  • -

#4 zaind  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 10-December 12

Re: How to double click mp3 and have my player play it?

Posted 15 December 2012 - 11:45 AM

View PosttlhIn`toq, on 10 December 2012 - 08:45 AM, said:

There are more than 500,000 users on the DIC. Can you imagine if they all titled threads as "Help" ? Please use meaningful titles so the people with the most knowledge in your area are drawn to your question. This also helps people later using search engines to find the help they need.
===========================================

Quote

if I open a music file directly from my desktop

Are you saying you want to associate double-click on a music file with your application? Or are you drag-dropping the music files onto the icon for your application? What exactly do you mean by this part and how is it associating those files with your application?


Sorry for the title and everything
Well what I want to do is that if I right click on a MP3 file on my desktop or any
Other drive and I chose to open my file with my application. I want my code to skip the
First welcome form add this song to the playlist and start playing it.
Thanks
Was This Post Helpful? 0
  • +
  • -

#5 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: How to double click mp3 and have my player play it?

Posted 15 December 2012 - 12:22 PM

Anything sent to your application via right-click, or double-click when the file type is associated with your program, or when it's started from a command line, is sent via CommandLineArgs.

Try this:
     Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If My.Application.CommandLineArgs.Any = True Then
            Debug.Print("Don't show welcome page")
            For Each arg In My.Application.CommandLineArgs
                Debug.Print(arg)
            Next
        Else
            Debug.Print("Show welcome page")
        End If
    End Sub


Was This Post Helpful? 3
  • +
  • -

#6 zaind  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 10-December 12

Re: How to double click mp3 and have my player play it?

Posted 16 December 2012 - 12:48 AM

View Postlar3ry, on 15 December 2012 - 12:22 PM, said:

Anything sent to your application via right-click, or double-click when the file type is associated with your program, or when it's started from a command line, is sent via CommandLineArgs.

Try this:
     Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If My.Application.CommandLineArgs.Any = True Then
            Debug.Print("Don't show welcome page")
            For Each arg In My.Application.CommandLineArgs
                Debug.Print(arg)
            Next
        Else
            Debug.Print("Show welcome page")
        End If
    End Sub



Thanks alot
Another question.
Is it possible to import the MP3 file image/ cover into picture box ?
:D
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5441
  • View blog
  • Posts: 11,674
  • Joined: 02-June 10

Re: How to double click mp3 and have my player play it?

Posted 16 December 2012 - 07:56 AM

View Postzaind, on 16 December 2012 - 01:48 AM, said:

Another question. Is it possible to import the MP3 file image/ cover into picture box ?>


Of course its possible. You've seen other programs do it. Its your code. Do anything you like.
Was This Post Helpful? 0
  • +
  • -

#8 zaind  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 10-December 12

Re: How to double click mp3 and have my player play it?

Posted 16 December 2012 - 12:06 PM

View PosttlhIn`toq, on 16 December 2012 - 07:56 AM, said:

View Postzaind, on 16 December 2012 - 01:48 AM, said:

Another question. Is it possible to import the MP3 file image/ cover into picture box ?>


Of course its possible. You've seen other programs do it. Its your code. Do anything you like.

Haaha
Okay so. I have tried everything to import picture. I have tried most of the media player controls and picture box controls
But I can't find a way to access the MP3 picture.
Oh and another thing I am thinking to start little bit of app development on windows 8
Your thoughts :D
Was This Post Helpful? 0
  • +
  • -

#9 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5441
  • View blog
  • Posts: 11,674
  • Joined: 02-June 10

Re: How to double click mp3 and have my player play it?

Posted 16 December 2012 - 12:42 PM

I assume the art is in the MP3 tags.
http://social.msdn.m...11-0d94f7a9ad89

Thread on Win8 development

The other thread on Win7 or Win8
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1