Time of song and Time elapsed on a MP3 player
I cant figure out how i make a time of song and time elapsed line. I all ready made the mp3 player.
Here is the AC3 code. If anyone can help me with this i would be a very happe man.
package {
import fl.controls.DataGrid;
import fl.data.DataProvider;
import flash.data.SQLConnection;
import flash.data.SQLStatement;
import flash.desktop.Clipboard;
import flash.desktop.ClipboardFormats;
import flash.desktop.NativeDragManager;
import flash.display.MovieClip;
import flash.display.NativeWindow;
import flash.display.NativeWindowInitOptions;
import flash.display.NativeWindowSystemChrome;
import flash.display.NativeWindowType;
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.NativeDragEvent;
import flash.events.TimerEvent;
import flash.filesystem.File;
import flash.filters.DropShadowFilter;
import flash.media.ID3Info;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundMixer;
import flash.media.SoundTransform;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.utils.Timer;
public class AudioGear extends Sprite
private var connect:SQLConnection;
private var currentSound:Sound;
private var yOffset:Number;
private var st:SoundTransform;
private var nw:NativeWindow;
private var window:MovieClip;
private var tracer:int;
private var channel:SoundChannel;
private var tfText:String;
private var len:int;
public function AudioGear()
init();
listeners();
private function init():void
initDB();
buildWindow();
initObjects();
private function initObjects():void
background.mouseEnabled = true;
playToggle.buttonMode = true;
playToggle.mouseChildren = false;
tf.background = true;
tf.backgroundColor = 0x000000;
tf.mouseEnabled = false;
tf.text = "Drag MP3 file here";
prevBtn.buttonMode = true;
playBtn.buttonMode = true;
nextBtn.buttonMode = true;
st = new SoundTransform(1, 0);
channel = new SoundChannel();
try {
currentSound = new Sound(new URLRequest(window.grid.getItemAt(0).Location));
catch(event:Error)
private function initDB():void
var file:File = File.applicationStorageDirectory.resolvePath("playlist.db");
connect = new SQLConnection();
connect.open(file);
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "CREATE TABLE IF NOT EXISTS PLAYLIST (Artist TEXT, Song TEXT, Location TEXT)";
statement.execute();
private function listeners():void
closer.addEventListener(MouseEvent.CLICK, handleWindow);
mini.addEventListener(MouseEvent.CLICK, handleWindow);
background.addEventListener(MouseEvent.MOUSE_DOWN, moveWindow);
playToggle.addEventListener(MouseEvent.CLICK, togglePlayList);
volControl.slider.addEventListener(MouseEvent.MOUSE_DOWN, sliderDown);
prevBtn.addEventListener(MouseEvent.CLICK, buttonClick);
playBtn.addEventListener(MouseEvent.CLICK, buttonClick);
nextBtn.addEventListener(MouseEvent.CLICK, buttonClick);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
private function moveWindow(event:MouseEvent):void
stage.nativeWindow.startMove();
private function handleWindow(event:MouseEvent):void
if(event.target == closer)
stage.nativeWindow.close();
nw.close();
else
stage.nativeWindow.minimize();
nw.minimize();
private function sliderDown(event:MouseEvent):void
volControl.slider.removeEventListener(MouseEvent.MOUSE_DOWN, sliderDown);
stage.addEventListener(MouseEvent.MOUSE_MOVE, sliderMove);
stage.addEventListener(MouseEvent.MOUSE_UP, sliderUp);
yOffset = mouseY - event.target.y;
private function sliderMove(event:MouseEvent):void
var mc:MovieClip = volControl.slider;
mc.y = mouseY - yOffset;
if(mc.y <= 0)
mc.y = 0;
else if(mc.y >= (100))
mc.y = (100);
updateVolume(mc.y);
event.updateAfterEvent();
private function sliderUp(event:MouseEvent):void
stage.removeEventListener(MouseEvent.MOUSE_MOVE, sliderMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, sliderUp);
volControl.slider.addEventListener(MouseEvent.MOUSE_DOWN, sliderDown);
private function updateVolume(num:Number):void
var vol:Number = (100 - (num*1))/50;
SoundMixer.soundTransform = st;
st.volume = vol;
private function dragEnter(event:NativeDragEvent):void
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, dragDrop);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_EXIT, dragExit);
var clip:Clipboard = event.clipboard;
var object:Object = clip.getData(ClipboardFormats.FILE_LIST_FORMAT);
tfText = tf.text;
if (object[0].extension.toLowerCase() == "mp3")
NativeDragManager.acceptDragDrop(this);
tf.text = "Drop it";
else
tf.text = "Not a MP3 file";
private function dragExit(event:NativeDragEvent):void
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_EXIT, dragExit);
tf.text = tfText;
private function dragDrop(event:NativeDragEvent):void
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_EXIT, dragExit);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_DROP, dragDrop);
var clip:Clipboard = event.clipboard;
var object:Object = clip.getData(ClipboardFormats.FILE_LIST_FORMAT);
var req:URLRequest = new URLRequest(object[0].url);
var sound:Sound = new Sound();
sound.addEventListener(Event.COMPLETE, soundLoaded);
sound.load(req);
tf.text = "LOADING...";
private function soundLoaded(event:Event):void
currentSound = event.target as Sound;
var id:ID3Info = currentSound.id3;
var artist:String = id.artist;
var song:String = id.songName;
var url:String = currentSound.url
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "INSERT INTO PLAYLIST (Artist, Song, Location) VALUES (?, ?, ?)";
statement.parameters[0] = artist;
statement.parameters[1] = song;
statement.parameters[2] = url;
statement.execute();
loadData();
window.grid.selectedIndex = len-1;
tracer = -1;
tf.text = "Thank you";
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
private function onTimer(event:TimerEvent):void
if(tf.text == "THANK YOU!")
tf.text = tfText;
var timer:Timer = event.target as Timer;
timer.stop();
private function loadData():void
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "SELECT * FROM PLAYLIST";
statement.execute();
try
var dp:DataProvider = new DataProvider(statement.getResult().data);
window.grid.dataProvider = dp;
catch(event:Error)
len = window.grid.length;
private function buttonClick(event:MouseEvent):void
var mc:MovieClip = event.target as MovieClip;
var string:String = mc.name;
switch(string)
case "playBtn" :
if(mc.currentLabel == "play")
try
playSong(currentSound.url);
catch(event:Error)
else
mc.gotoAndStop("play");
SoundMixer.stopAll();
break;
case "nextBtn" :
playNextSong();
break;
case "prevBtn" :
playPrevSong();
break;
private function playNextSong():void
if(tracer == len)
tracer = 0;
else
tracer++;
handleNextPrev();
private function playPrevSong():void
if(tracer == 0)
tracer = len;
tracer--;
handleNextPrev();
private function handleNextPrev():void
var string:String;
try
string = window.grid.getItemAt(tracer).Location;
currentSound = new Sound(new URLRequest(string));
SoundMixer.stopAll();
playSong(string);
catch(event:Error)
string = window.grid.getItemAt(0).Location;
currentSound = new Sound(new URLRequest(string));
SoundMixer.stopAll();
playSong(string);
private function playSong(string:String):void
try {
playBtn.gotoAndStop("stop");
for(var i:int; i<len; i++)
if(string == window.grid.getItemAt(i).Location)
tracer = i;
window.grid.selectedIndex = i;
var object:Object = window.grid.getItemAt(tracer);
if(object.Artist == null)
object.Artist = "";
if(object.Song == null)
object.Song = "";
tf.text = object.Artist + " - " + object.Song;
channel = currentSound.play();
channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
catch(event:Error)
private function onSoundComplete(event:Event):void
playNextSong();
private function togglePlayList(event:MouseEvent):void
if(playToggle.ty.text == "Show Playlist")
loadData();
setCoords();
nw.visible = true;
window.grid.selectedIndex = tracer;
playToggle.ty.text = "Hide Playlist";
else
nw.visible = false;
playToggle.ty.text = "Show Playlist";
private function buildWindow():void
var nwo:NativeWindowInitOptions = new NativeWindowInitOptions();
nwo.maximizable = false;
nwo.resizable = false;
nwo.transparent = true;
nwo.systemChrome = NativeWindowSystemChrome.NONE
nwo.type = NativeWindowType.LIGHTWEIGHT;
nw = new NativeWindow(nwo);
nw.title = "Playlist";
window = new Window();
window.deli.ty.text = "Delete";
window.mouseEnabled = false;
window.addEventListener(MouseEvent.MOUSE_DOWN, moveNatWin);
nw.stage.stageWidth = window.width+10;
nw.stage.stageHeight = window.height+10;
nw.stage.scaleMode = StageScaleMode.NO_SCALE;
nw.stage.align = StageAlign.TOP_LEFT;
window.filters = [new DropShadowFilter(4, 90, 0x000000, 1, 4 ,4, 0.66, 3)];
window.x = 5;
window.y = 0;
nw.stage.addChild(window);
setCoords();
window.grid.addEventListener(Event.CHANGE, gridChange);
window.deli.addEventListener(MouseEvent.CLICK, deliClick);
loadData();
private function setCoords():void
nw.x = stage.nativeWindow.x;
var theY:Number = (stage.nativeWindow.y + stage.nativeWindow.height)
nw.y = theY;
private function deliClick(event:MouseEvent):void
try
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "DELETE FROM PLAYLIST WHERE Location = ?";
statement.parameters[0] = window.grid.selectedItem.Location;
var string:String = window.grid.selectedItem.Location;
var item:int = window.grid.selectedIndex;
statement.execute();
loadData();
if(currentSound.url == string)
currentSound = new Sound(new URLRequest(window.grid.getItemAt(0).Location));
len = window.grid.length;
try
window.grid.selectedItem = window.grid.getItemAt(item-1);
catch(event:Error)
window.grid.selectedItem = window.grid.getItemAt(0);
} catch (event:Error) {
private function gridChange(event:Event):void
var dg:DataGrid = event.target as DataGrid;
currentSound = new Sound(new URLRequest(dg.selectedItem.Location));
private function moveNatWin(event:MouseEvent):void
var mc:MovieClip = event.target as MovieClip;
var st:Stage = mc.parent.parent as Stage;
st.nativeWindow.startMove();
Hello there,
You're in the forum for Acrobat.com. We can't help with questions about other products; I'm not sure what you're using for your project, but it's not likely you'll find the help you're looking for in this particular forum. Sorry!
Rebecca
Similar Messages
-
Differences between Time ticket (CO11N) and Time Event (CO19)
Hi Guru
Could you please briefly explain differences in between Time ticket (CO11N) and Time Event (CO19) during Prd Ord confirmation?
I tried searching for relevant material but could not get any.
Please adviseDear Lyonie,
In my understanding CO11N, is generally used to confirm the production execution at operation level or sub operation level or
normally for milestone operation confirmation.Automatic Goos movement can also be performed when this T Code is executed.
There is no track of exact setup start time,end time,execution start time and end time.
Using CO19,we can track the or post the exact or actual setup start time,setup end time,processing start time,end time for each
operation.
More related to Time Eevnt confirmation,
Time Event Confirmations
Every confirmed time event is assigned internally to a record type group:
Setup times are assigned to record type group 1.
Processing times are assigned to record type group 2.
Teardown times are assigned to record type group 3.
Each record type group can be assigned to one or more parameters in the standard value key for the work center (for example machine time). (See Customizing in Production ® Basic data ®Work center ® General data ® Standard value ® Define standard value key). The link between time event and parameter ensures that the calculated duration counts as an activity (for example, when calculating the actual costs of the operation.
The processing of an operation requires both machine time and labor time. The time event confirmation for the processing section of the operation can take effect on activity u2018machine timeu2019 and on u2018processing timeu2019, if you enter record type group u20182u2019 for the parameters u2018machineu2019 and u2018laboru2019 in the standard value key.
You can only confirm quantities when you confirm processing time events.
You can only confirm activities that cannot be assigned to a particular record type group (Set-up, processing, teardown) by using the time event u2018Variable activityu2019. The confirmed value is assigned to corresponding value in the standard value key parameters.
Regards
S Mangalraj -
Got a Riptunes MP3 player and put USB cord from MP3 player to MacBook Pro to transfer songs and my computer immediately shut down and won't power back up and won't charge now....what do I do!?
Take it in for a service diagnostic so you can determine if it's worth fixing or if you should buy a new one.
-
How do I copy songs from my cd to my mp3 player
I have copied songs from my cd to my mp3 player but they wont play. Can you help?
Hi,
Have you converted the CD Audio files to mp3 format? If not, you can use Windows Media Player to do this as described in the guide on the following link.
http://windows.microsoft.com/en-GB/windows7/Rip-music-from-a-CD
Regards,
DP-K
****Click the White thumb to say thanks****
****Please mark Accept As Solution if it solves your problem****
****I don't work for HP****
Microsoft MVP - Windows Experience -
My Macbook Pro will be going in for reimaging and my hard drive will be wiped, I want to know if all my iTunes preferences will be copied if I have backed them up on Time Machine. Specifically, if I have set certain "Start Time" and "Stop Time" for my songs, and I copy my iTunes library, will these "Start Time" and "Stop Time" options remain or will I have to manually set them one by one once again? I need a reply ASAP! Thanks so much!
As far as I'm aware the start & stop times are stored in the library database, not the media files. If you backup/restore/transfer the whole library then the settings are included. If you create a complete copy of your iTunes folder on another drive you can connect to that copy by holding down option/alt as you start iTunes so you can check that everything is working properly before you send the Macbook away.
tt2 -
Please I need help my iPod is not working I have problems for the internet, the date and time is other like if today is March 9,2014 and the time is 9:44 Pm it tells me that is March 11,2014 and the time 3:15 Am! And it turns of all the time!
- Reset the iOS device. Nothing will be lost
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Reset all settings
Go to Settings > General > Reset and tap Reset All Settings.
All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
- Restore from backup. See:
iOS: How to back up
- Restore to factory settings/new iOS device.
If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
Apple Retail Store - Genius Bar -
X6 = "1/5/15 5:16 AM" & NOW ....................difference by Only Time
not date
X6 date and Time will be changing, Its not Constant
Dim myDateTime As DateTime = X6
Dim myDate As String = myDateTime.ToString("dd/MM/yy")
Dim myTime As String = myDateTime.ToString("hh:mm tt")
Dim myDateTime1 As DateTime = Now
Dim myDate1 As String = myDateTime1.ToString("dd/MM/yy")
Dim myTime1 As String = myDateTime1.ToString("hh:mm tt")
Need to use this function to find the Difference between Two Time. due to 12:00 AM isuue
Function XLMod(a, b)
' This replicates the Excel MOD function
XLMod = a - b * Int(a / b)
End Function
Output Required
dim dd = XLMod(myTime - myTime1)
Problem is myTime & myTime1 is String Need to convert them into Time, Later use XLMOD Funtion.Induhar,
As an addendum to this, I thought I'd add this in also: If you have two valid DateTime objects you might consider using a class which I put together a few years ago
shown on a page of my website here.
To use it, just instantiate with two DateTime objects (order doesn't matter, it'll figure it out) and you'll then have access to the public properties. For this example, I'm just showing the .ToString method:
Option Strict On
Option Explicit On
Option Infer Off
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim date1 As DateTime = Now
Dim date2 As DateTime = #1/1/1970 2:35:00 PM#
Dim howOld As New Age(date1, date2)
MessageBox.Show(howOld.ToString, "Age")
Stop
End Sub
End Class
I hope that helps, if not now then maybe at some point in the future. :)
Still lost in code, just at a little higher level.
Thanx frank, can use this in Future.... -
Time Capsule: Storage and Time Machine - Could this work?
Hi everyone,
my Macbook got stolen last Friday and thank God I had an external HD and Time Machine (TC)to keep all my data. Now here's the dilemma.
I bought time capsule (1TG) to use as a back up. I figure I can hide it somewhere in the house and not worried about having it disappeared. My laptop should be here tomorrow, so I want to get it right before do anything.
The present external HD is partitioned in 2: 250 Gb for time machine, and 250Gb for other storage (iMovie projects etc etc.)
Since I cannot partitioned TC, I was wondering if this would work.
When I get my laptop (Macbook - w. 320 Gb HD), I will do my re import for my data (appr.60Gb) from my first HD, then let time machine do its thing with TC. Now here's what I want to do. Take all the "storage" (appr. 200Gb), import it to the Macbook , use time machine to back it up. Then I delete the "storage" from my macbook, so it's not 3/4 full before I even install programs such as Aperture. If this works, that means I would have access to all my storage if I return to day 1 of time machine. Do you think it will work, or is time machine going to dump it after a certain amount of time?
Thanks in advance,
SGYou needn't go to all that trouble if you simple connect your old backup drive to the computer then exclude the TM backup partition from the TC in TM. TM will backup both your computer's drive and the storage partition on your other drive. The storage partition will be backed up separately on the TC from the computer's drive. If you copy that data to your computer's drive then backup entirely to the TC then delete the data from your computer's drive, the backup on your TC will eventually be deleted as well and you'll have no backup of the data on the external drive's storage partition.
A TM backup is not simply a substitute for storage space. Once you delete a file that has been backed up by TM eventually when TM does a weekly or monthly consolidation it will delete the file and all its copies from the backup. -
Hi everybody,
I'm new with LabView.
I try to get timestamps when I have a digital input on a NI 6233 card. For that I am using a counter/timer which is synchronising my digital waveform input, like an example shows.
When I calculate the period with two timestamps afterwards I see weird results. (see jpeg)
Does anybody know if this is a software or hardware issue? How can I fix that?´
Attached you can find also the vi.
Attachments:
Period Time.jpg 157 KB
Timer.vi 41 KBHi Patrick,
I try to measure the period of a rotating part. I am using a proximity sensor to give me a digital high signal for each rotation.
In the vi I am using a counter/timer to syncronize my digital input. Afterwards I am using my data signal twice. Once I am using it to get a boolean which starts a case structure. In there I am using the data signal a second time to get my a timestamp which gets also transformed into seconds. I am saving this value to a tdms file.
With this timestamp I am calculating the period in another program. For some reason the period has descrete values which shows the jpeg.
Do you have a better way to get the timestamp or even the period?
Thanks. -
How do i transfer my itunes songs from my computer to an mp3 player
how do i transfer my itunes songs from my computer to an mp3 player
Right-click them in iTunes, show them in the Windows Explorer, and check the player's documentation for the rest of the instructions.
(105075) -
Time infotype macrocs and time infotype definition.
Hi All,
Please provide me the following information
1. what are the MACRO related to time infotypes ?
2. how to define infotypes for Time data ?
3. what is thedifference between PNPCE and PNP logical database ?
Please provide me some documents and smaal code snippets or program.. to get tghe clear idea afor the same..
Please reply asap..its urgent..
Thanx in advance.
Amruta Sawant.Hi Jothi,
use this macro for all time infotypes
<b>rp_read_all_time_ity pn-begda pn-endda</b>.
Bhawanidutt -
Over Time Approval process and Time Balance Reconciliation at Termination P
Hi Friends,
I would like to know generic Overtime approval process in Time management & also the process for Time balance Reconciliation at termination.
These both process are in my project scope.I have to draw a flowchart two both of the above process to my client.
Can any one of you help me out,with process flow charts are you give me a scenarion,wher i can draw a flowchart also appreciated.
Thanks,
LasyaHi,
For overtime approval process... either u can use IT 2005. or You can use IT 2007 for overtime quota and 2002 for Approval process. Its also mentioned in one of the SAP HR Book HR311. You can refer that book, Its in detail and really going to help you..
Regards
Pradeep -
MSS Time Approval Configuration and Time Approval that breaks from OM Struc
Hi,
Can any one let me know how we configure the MSS for below requirement.
Time Approval Configuration
Custom Relationship Configuration for Time Approval that breaks from OM Structure
Thanks,
HCMdepends on your settings in workflow 'agent determination'.
in sap std workflow the agent for leave approval by default is the 'chief' position holder of an org unit.
so i guess you may want to copy the std workflow into your customer name space and have a workflow consultant customise it to enable the workflow to use the z-relationship object instead of the chief position holder. -
Time-Dependent Publishing and Time-Base Publishing
Hi All;
We are using EP6 SPS17...we have enabled Time Based Publishing service on a CM repository folders structure.
The challenge is to make the resource visible to read only users programmatically meaning, what is the APIs used to modify the VALID TO value on every resource without the need to enable it through Details --> properties --> Lifetime UI
Thanx,
JavedHi,
Try with this:
http://etower.towersemi.com/irj/portalapps/com.sap.portal.pdk.km.repositoryservices/docs/repositoryservices.html#timebased%20publishing
Patricio. -
How do I play and control music from my MP3 player through my
Thanks in advance
Tommyknocker,
How about just a simple minijack to minjack patch cable, from headphone out into the line-in on your soundard? The Soundcard's mixer could be used to set volume and then you still have control on the player, current song information listed in front of you, and can use the volume on the player when needed to mute / lower for different scenes in the game.
Daniel
Maybe you are looking for
-
I allowed a System Update that included a Xerox Printer update. I am running a MacPro 10.6.8 with Quark 8.5.1 and a Xerox ColorQube 8700S. EVERY was working perfectly before the "update" but afterwards anything sent to the printer from Quark would s
-
Help on accessing tables in Java available in SAP system
Hi All A day before I had posted a question regarding the accessing of tables available in SAP R/3 system in my Java code. I got the following code as reply. This code is working fine. But in the below example, the QUERY_TABLE IS BSAUTHORS. In my cas
-
Character with extension display-problem
Dear all, I have forms10 in a UTF8 environment, using JPI technology with JRE 1.6 I'm able to write letters with extension, letters are well saved in the database, but the problem I'm facing is that I'm getting the letter not well displayed in forms,
-
I have an application (test.jar) built to read keys and return its code. The app. runs fine, if I run it from Windows or UNIX. I need to test this app with an external device. Say electronic Time Clocks. It has Linux OS built-in and I could successfu
-
OS 10.4.11 wants to move up
I've been using 10.4.11 for quite some time. I feel like I'm being left behind. What's the next OSX for me to upgrade to. Snow Leopard seems very expensive. Is there a place to get Leopard and move up to Snow Leopard later? We have 2 Macs in our hous