Post on 28-Dec-2015
LOGOLOGO
E-Radio code presentationE-Radio code presentation
Prepared By Prepared By Abdullah Mustafa Abu NadaAbdullah Mustafa Abu Nada 120070069120070069Hussian Abd-Jaleel Shaalan Hussian Abd-Jaleel Shaalan 120070105120070105Nael Wael SkaikNael Wael Skaik 120070275120070275
Software group project
Add your company slogan
LOGOLOGO
Contents
Parts of project1
E-radio WEB application2
E-radio Windows application3
4
Add your company slogan
LOGOLOGO
Project parts
Windows APP
For streaming audio files from PC. VB.NET
E-Radio
WEB APP
For managing the radio station web site and receive streaming.PHP and MYSQL
Add your company slogan
LOGOLOGO
WEB APP
Classes
Main setting ClassMessage Bean Class
DJ bean Class
Integrated software Bean
Playlist Bean Class
Program Bean
Add your company slogan
LOGOLOGO
WEB APP
Main setting Class :
This class contains the radio settings (name , description, URL, Port number).
Store this information in DB.
Add your company slogan
LOGOLOGO
WEB APP
DJ Class :
This class contains the DJ info. (name , picture , email , Status).
Store this information in database, and display DJ information.
Add your company slogan
LOGOLOGO
WEB APP
playlist Class: Create playlists and manage it.
Playlist programs Class: Responsible for adding the programs to playlists with out conflict.
Program Class: Adding programs and manage it.
Time Class: Adding times and manage it.
Add your company slogan
LOGOLOGO
WEB APP
Integrated software Class: Responsible for adding the society website links and manage its.
Message Class: Responsible for sending and receiving messages from and to visitor
admins and DJs.
Add your company slogan
LOGOLOGO
Desktop APP
BASS API
Streaming
Start severStart severGet audio Get audio filesfiles
Add your company slogan
LOGOLOGO
libraries
System. Threading :enable multithreaded programming. In addition to classes for synchronizing thread activities.
System. Net. Sockets :provides a managed implementation of the Windows Sockets.
Add your company slogan
LOGOLOGO
Start Server
Start Server()
Start the server (socket) . Determine the total number of connection can be Listen it in the
server . Creates an IP Address instance from an IP address . Identify current port . Identify Directory to get audio files.
Add your company slogan
LOGOLOGO
Start Server
Public Function StartServer() As Boolean
CurrentIP = Me.Comboip.Text.Trim Dim address As IPAddress = IPAddress.Parse(CurrentIP) Currentport = TxtPort.Text 'idenfy current port CurrentDir = Me.txtDir.Text 'identfy Directory to GetFiles Dim EndPoint As IPEndPoint = New IPEndPoint(address, Int32.Parse(Currentport)) ss = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Udb) ss.Listen(20) ThreadAccept = New Thread(AddressOf ThreadAcceptRun) ThreadAccept.IsBackground = True ThreadAccept.Start()
Add your company slogan
LOGOLOGO
Thread Accept Run()
Thread Accept Run()
Enables our application to have more than one execution path at the same time and multiple connection which IP current listing.
If the Connection accepted , then Initialize the Server class.
Add your company slogan
LOGOLOGO
Thread Accept Run()
Private Sub ThreadAcceptRun() ThreadAcceptRunning = True Do While Not DoStop Try ' Wait for an incoming connections sock = ss.Accep ' Connection accepted ' Initialise the Server class Dim ServerRun As New Server(sock, CurrentDir, Me.TxtName.Text) ' Create a new thread to handle the connection Dim t As Thread = New Thread(AddressOf ServerRun.HandleConnection) t.IsBackground = True End Sub
Add your company slogan
LOGOLOGO
The handler for the load event
The handler for the load event Gets the path for the executable file that started in the
application.
create the Directory TMP stream to load the current files(*.mp3) where it run.
Handle Connection Create byte array buffer. Stream byte array by using BASS API.
Add your company slogan
LOGOLOGO
The handler for the load event
Directory.CreateDirectory(Application.StartupPath & "\tmp_streams") 'CREATE THE Directory TMP STREAM TO LOADED THE CURRENT FILES(*.mp3) WHEN RUN IT End If Dim filestr As String For Each filestr In Directory.GetFiles(Application.StartupPath & "\tmp_streams", "*.mp3") 'GET THE CRRENT FILES THAT TRANSFER FROM Directory SONGS TO Directory tmp_streams TO RUN IT IN mp3 PROGRAM Try File.Delete(filestr) Catch ex As Exception End Try
LOGOLOGO