Another empeg control widget (for OS X)

Posted by: mcomb

Another empeg control widget (for OS X) - 27/05/2003 19:03

Well, laziness finally prevailed and reaching all the way to the shelf in my cube to control the empeg became to much. So I wrote a little OS X menu item to control the empeg via hijack over http. This runs as a background app so it doesn't take any space in the dock and only uses space in the menubar if an empeg is on the network. If multiple empegs are on the network it (should) provide a control menu for each. It also shows the current track playing via a tool tip if you mouse over it.

It only provides a couple of functions (ones that I would actually use) at the moment, but I can add more if anybody actually uses it and wants something else. Read the included Readme file for installation instructions and requirements.

Screenshot 1...

Screenshot 2...

Download it at EmpMenuX if you are interested.

-Mike
Posted by: adavidw

Re: Another empeg control widget (for OS X) - 27/05/2003 21:38

Whoa.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 28/05/2003 09:53

Whoa? (Is that a good whoa or a bad whoa?)
Posted by: loren

Re: Another empeg control widget (for OS X) - 28/05/2003 10:02

I think that's bad ass, and i don't even run OSX. man... more and more reasons to "go back home" to macs every day..
Posted by: mlord

Re: Another empeg control widget (for OS X) - 28/05/2003 10:47

Wow!
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 28/05/2003 17:04

more and more reasons to "go back home" to macs every day

Anything I can do to convert another ;-)

Incidently there is a new version up with a few additional commands. I have also posted the source since a curious soul sent me a PM about it. Both are available from EmpMenuX.

-Mike
Posted by: jdandrea

Re: Another empeg control widget (for OS X) - 28/05/2003 20:37

Thank you!

Thoroughly enjoying my switch to MacOS X. Interface Builder is really wonderful. Of course I can only compare this to the days when we had to code Windows resources by hand and the SDK came on floppies. <LOL>
Posted by: adavidw

Re: Another empeg control widget (for OS X) - 28/05/2003 22:59

Whoa? (Is that a good whoa or a bad whoa?)

It's my Keanu Reeves impression. No, it means I'm blown away. I like.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 29/05/2003 16:07

Version 0.3 is now up with one bugfix (the menu wasn't going away when the empeg was disconnected from the network) and one small enhancement (the empeg's screen displays a message when it is first discovered). That is probably it for a bit, I may try for some more interesting enhancements this weekend.

-Mike
Posted by: fusto

Re: Another empeg control widget (for OS X) - 30/05/2003 06:32

For us Windoze users, we've been lucky enough to have the use of EmpegTray for a while now.
Glad to see that you mac boys now also no longer have to reach dangerously over to the empeg. Its a good way to get an injury.

Looks very slick too...
Posted by: sn00p

Re: Another empeg control widget (for OS X) - 30/05/2003 11:08

I have a question, slightly off topic, but mac related....

I have a powermac (700 Mhz G4 - silver tower) and I'm a windows programmer by day, i've not really used the mac in a while (OS X does look *really* nice) because I found OS-X to be too slow (Was running jaguar), I tried doing some devloping but codewarrior was very slow.... How do you guys do it? Are the newer versions of jaguar and OS-X any faster?

Thanks.

Adrian
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 30/05/2003 11:21

How do you guys do it?

Well, I have three macs (two work, one personal) running Jaquar and the *fastest* of the three is a 350Mhz G4. They key is gobs of RAM and a little extra patience. I find Jag to be plenty fast enough for day to day work and the benefits of unix underneath with a usable GUI on top more than make up for the occasional slowness.

-Mike
Posted by: sn00p

Re: Another empeg control widget (for OS X) - 31/05/2003 01:49

Do you use the (supplied) gnu tools to create your little apps? I may have to have another play with my mac (mac os x was very nice) and try creating a little program... Just need to download some updates to jaguar....

Thanks

Adrian
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 31/05/2003 08:30

Do you use the (supplied) gnu tools to create your little apps?

I use Apple's IDE (Project Builder) a lot. EmpMenuX is actually written in java (I am a java programmer by day and I think in java better than in ObjC) as a native Cocoa application. Because most of what I do is in java I don't touch gcc much except for compiling other peoples programs. I use a lot of the other gnu utilities for various things on a regular basis. It is trivial to create a small program with Cocoa (one of Apples programming APIs) using Project Builder and Interface Builder in either java or objective C. Most of EmpMenuX was done in about two hours and most of that time was me trying to find the right API to add stuff to the top menubar.

-Mike
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 11/06/2003 13:43

OK, version 0.4 is now available with a variety of shinny new changes...

  • Preferences dialog that allows you to disable commands you do not use.
  • Ability to scroll current temperature for a U.S. zipcode on the empeg's screen.
  • Ability to scroll stock quotes on the empeg's screen.
  • Ability to scroll RSS feed headlines (Slashdot stories, etc) on the empeg's screen.
  • Ability to control how often items are scrolled in the Preferences.
  • Ability to control how often new empegs are looked for on the network in the Preferences.
  • Generally rearranged the source to make it more sane to read/update.


If anybody using this wants the ability to scroll something else on the screen speak up and I will see if I can add it.

-Mike
Posted by: 303

Re: Another empeg control widget (for OS X) - 03/07/2003 04:32

just found this tool.
it is so cool!!!
now i need to get it going with my AirPort, any ideas why it doesn´t work???
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 03/07/2003 14:15

it is so cool!!!
now i need to get it going with my AirPort, any ideas why it doesn´t work???

Thanks! It uses UDP broadcast to find your empeg(s) and assumes your broadcast address is 255.255.255.255 which it may not be if you have your network segmented in a funky way. Will jEmplode work over your AirPort? If so I will have to borrow a little more discovery code from it to properly determine the broadcast address.

-Mike
Posted by: wfaulk

Re: Another empeg control widget (for OS X) - 03/07/2003 16:52

jEmplode's discovery isn't superb, either. If your IP address is a.b.c.d, it tries a.b.c.255, a.b.255.255, and a.255.255.255, and 255.255.255.255. That is, unless it's changed recently. While this may work for some folks, it doesn't for me, as one of my broadcast addresses is a.b.c.127.
Posted by: key

Re: Another empeg control widget (for OS X) - 03/07/2003 17:24

Howdy! I'm not a Java coder, but I am a crusty old UDP & BSD kernel
code-whacker. To properly do UDP-based discovery in a BSD-based
networking stack (like OS X) , you need to send to the broadcast
address of each interface marked UP and BROADCAST by the kernel.
This will allow the kernel code to get the broadcast to each interface.
Sending to All-Ones Broadcast on a Berkeley-based network stack only
gets the message out the first discovered interface (by the Host Reqs RFC,
it's an stack implimentation decision what to do - pick one vs. flood to each
interface.)

I looked at the JEmplode source (20b13) and thought it was going to try to
do the Right Thing with it's interfaceToBroadcastAddress hashtable
(in org/jempeg/empeg/ protocol/NetworkEmpegDiscoverer.java) However,
on closer inspection, it's faking out b'cast net addresses by 1) assuming
8-bit subnet masks from all of the IP addresses it can get from Java. To
make matters worse, it gets the addresses from java by calling
InetAddress.getAllByName(), which (by looking at the J2SE v1.4.2 sources),
is returning the list of IP addresses associated with the HOSTNAME in
the various name services (i.e., host tables, DNS, etc).

Please don't take this as a knock of the JEmplode folks. I'm just trying to
explain what the JEmplode code is Really Doing vs. what it Needs To Do
for multiply-homed hosts. I have no idea how to get the real interface
info up into Java (heck, I don't even know how to create JAR files :-)

For some reason, I can't download the source for your app right now, so I
can't tell if you cloned that part of the code. I don't *think* you did, as I'm
having the same problem with my TiBook and airport card and the above
hack should work for my situation but I can't discover the Empeg with your
app. Is there any way to get to your Preferences settings with no Empeg
discovered?

The reason all the above sounds a little hand-wavy is my Mac's at home so
I can't test it right now. I'm at work avoiding working on multi-OS build
environments and distorting NMAKE into performing some unnatural acts...

Hope this helps,
K^2
Posted by: wfaulk

Re: Another empeg control widget (for OS X) - 03/07/2003 17:32

I have no idea how to get the real interface info up into Java
Apparently, you can't. It's BugID 4691932. (Here's a real hacky class.)

Supposedly, the Java VM will transparently translate 255.255.255.255 into a real broadcast address, but which one it picks is beyond me. In reality, I don't see this being any different than what the OS is going to do on it's own, so that may have just been speculation based on empirical evidence.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 03/07/2003 22:02

Apparently, you can't. It's BugID 4691932

Yeah, that looks vaguely familiar I think I read that before at some point. I can't seem to load the linked hacky class for some reason. Since I am already platform specific (Cocoa UI) I suppose I could use a system call and grab the broadcasts from ifconfig output or some such. That is hacky too though.

-Mike
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 03/07/2003 22:08

I can't tell if you cloned that part of the code. I don't *think* you did

Nope, I just coded for the simplest case scenario (255.255.255.255) which worked for me. I figured I wouldn't bother finding the right way unless somebody actually used the program and had a problem. I guess that time is now.

Is there any way to get to your Preferences settings with no Empeg
discovered?

Nope, but they wouldn't do you any good anyway as I have no preferences for how discovery is done and I would prefer not to. I wanted to keep this as simple and user friendly as possible.

-Mike
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 11/07/2003 14:41

OK, can those of you having discovery problems please try the latest version (0.5) from my site. This version uses ifconfig output to find interface addresses and broadcast addresses. So it should work properly with multiple interfaces and funky broadcast addresses.

The updated discovery code and a new Icon (courtesy of BaBa) are the only changes in this version so if the previous version worked for you then you can skip this one.

-Mike
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 16/07/2003 21:16

OK, can those of you having discovery problems please try the latest version

DId anybody get a chance to try this? I am curious if that solved all the problems.

-Mike
Posted by: 303

Re: Another empeg control widget (for OS X) - 22/07/2003 10:04

"Will jEmplode work over your AirPort?"

yes it works!!!
Posted by: 303

Re: Another empeg control widget (for OS X) - 22/07/2003 10:12

sorry, just tried EmpMenuX over AirPort and it works perfect!!!

coooooool stuff i love ut


thanx

Posted by: adavidw

Re: Another empeg control widget (for OS X) - 23/07/2003 01:52

DId anybody get a chance to try this? I am curious if that solved all the problems.


I use airport to connect to the internet, and an ethernet cable to connect directly to the empeg. I let OS X and the empeg just auto-assign their own private IP addresses on ethernet when they both determine there's no dhcp server on that ethernet network.

With this setup, the previous version would not detect my empeg, even though jemplode would (sometimes, at least). I could down the airport interface and then it would work just fine.

With the new version, EmpMenuX detects the empeg 100% reliably.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 25/07/2003 12:18

With the new version, EmpMenuX detects the empeg 100% reliably.

Cool. Glad it is working for you guys.

-Mike
Posted by: Derek

Re: Another empeg control widget (for OS X) - 25/07/2003 22:12

now all we need is for some nice person to pack this code into Jemplode! It's getting to be a bit of a pain to have to kill my (Airport) internet connection, turn on my empeg and start Jemplode and then restart my internet connection after Jemplode has found the empeg so that I can do a software update.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 26/07/2003 13:54

now all we need is for some nice person to pack this code into Jemplode

The problem with that is the method I used is platform dependent (it relies on the unix ifconfig command) so it wouldn't work for those poor suckers running windows
Posted by: Derek

Re: Another empeg control widget (for OS X) - 27/07/2003 09:28

so it wouldn't work for those poor suckers running windows

oh poor poor them, my heart bleeds for them ... not!

besides which, they get to play with Emplode which is a little harder for use to get running. It would be nice to have some perks :-)

Anyway, would the Windoze NT family command ipconfig deliver the functionality you need? I presume it is no problem in Java to detect which platform you are running on.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 27/07/2003 11:49

Anyway, would the Windoze NT family command ipconfig deliver the functionality you need?

Probably, all I am using ifconfig for is the interface IPs and associated broadcast addresses. I have managed to avoid windows for the last few years and I don't remember exactly what ipconfig output looks like. Anyway, you would have to talk mschrag into adding something like this into jEmplode, and it really is kind of an ugly hack so I wouldn't be entirely surprised if he didn't want to deal with it.

-Mike
Posted by: drakino

Re: Another empeg control widget (for OS X) - 28/09/2003 22:56

Just remembered this and installed it on my new Powerbook. Very handy for changing what is playing while in bed browsing web sites. Thanks.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 29/09/2003 12:00

Thanks

Sure, glad it is coming in handy for a few people. Unfortunately I can't use it myself anymore as my empeg mysteriously decided to stop working with my office dhcp server a few weeks back (nothing on the LAN or the DHCP server changed at that time).

So, to hijack my own thread anybody know if there a way with hijack to set the IP address of the empeg only when it is in a mlord dock? I seem to remember their being macros to do stuff like that based on location (home/work), but don't you have to manually tell hijack where you are?

-Mike
Posted by: thinfourth2

Re: Another empeg control widget (for OS X) - 30/09/2003 11:46

Yes it is a most cool little widget
Posted by: jmwking

Re: Another empeg control widget (for OS X) - 30/09/2003 11:52

Unfortunately I can't use it myself anymore as my empeg mysteriously decided to stop working with my office dhcp server a few weeks back (nothing on the LAN or the DHCP server changed at that time).
Can you patch in a $20 10baseT hub? That worked for me in a similar situation.

-jk
Posted by: drakino

Re: Another empeg control widget (for OS X) - 30/09/2003 12:42

Random suggestion, have the menu item change into something when no empeg is found. The menu just disappearing completly when an empeg is not around is unexpected.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 30/09/2003 17:44

Random suggestion, have the menu item change into something when no empeg is found

Yeah, I thought about that, but it is actually setup to run multiple menus if it finds multiple empegs. I guess I could let all but the last one disapear. Maybe next time I am playing with the code.

-Mike
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 30/09/2003 17:47

Can you patch in a $20 10baseT hub? That worked for me in a similar situation.

Was DHCP not working for you or did you have no network access at all? I thought the 10BaseT hub trick was for when your empeg didn't like a 100BaseT network and wouldn't see it at all?

-Mike
Posted by: jmwking

Re: Another empeg control widget (for OS X) - 01/10/2003 07:39

Was DHCP not working for you or did you have no network access at all? I thought the 10BaseT hub trick was for when your empeg didn't like a 100BaseT network and wouldn't see it at all?
Well, to be honest, I didn't feel like sniffing the network to see if any dhcp requests were coming from the empeg - I just put it into a 10bT hub, and everything cleared up. I do know that if I put a static ip address in the empeg, it will work on my home 10/100 switch.

I've had way too many problems with various 10bT devices not behaving on theoretically autosensing switches, and have a little 4 port 10bT hub on my desk at work and at home for just this purpose.

-jk
Posted by: drakino

Re: Another empeg control widget (for OS X) - 10/10/2003 00:12

If multiple empegs are on the network it (should) provide a control menu for each.
Well, I have multiple empegs on the network right now, and it works, but with one problem...

  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
  580 EmpMenuX    38.2%  1:03.37  13   293   223  13.0M  15.9M  19.5M   293M
  315 loginwindo  24.5%  0:59.56   5   179   169  3.07M  5.89M  4.26M  99.2M


If I pull the power on one, the app removes the control for that empeg, and goes back to being unnoticible in CPU usage. This is with the display options like stocks and weather turned off on all units.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 11/10/2003 00:19

Well, I have multiple empegs on the network right now, and it works, but with one problem...

Hmm, thats not good. I never actually tested the multiple empeg support. I bet I need a synchronized block around something to avoid a race...
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 11/10/2003 18:02

Well, I have multiple empegs on the network right now, and it works, but with one problem..

OK, I think one of your empegs doesn't have hijack installed or isn't running the web server for some reason. I had a bug that burned a lot of CPU in that situation. There is now a new version up with the following changes...

1. (Your bug fix) Empegs that we can't talk to for some reason are not shown in the menu.
2. A new "searching" icon in the menu if no empegs are available.
3. Custom icons for your empeg (somebody asked for this). If you want a custom pic shown in the menu for your empeg instead of its name add a file with the same name as your empeg (if you empeg is named bob the file should be bob.jpg, bob.tiff, etc) at EmpMenuX/Contents/Resources/. You will need to control click on EmpMenuX.app and select "Show Package Contents" to navigate to this folder. The custom pic should be about 22 pixels tall and as wide as you want.

-Mike
Posted by: drakino

Re: Another empeg control widget (for OS X) - 11/10/2003 19:33

OK, I think one of your empegs doesn't have hijack installed or isn't running the web server for some reason.
Oops, forgot I upgraded the spare to 3.0, and didn't reapply hijack to it. Testing the new version in the same situation, and it is working properly now.
Posted by: thinfourth2

Re: Another empeg control widget (for OS X) - 14/10/2003 03:31

Oh it is even better plugged into the net

Right how do i get this RSS feed thing working with the BBc news feed as i can't find it and what i have found does not appear to work

Or is there a list somewhere of decent RSS feeds
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 14/10/2003 11:41

Or is there a list somewhere of decent RSS feeds

A quick google search doesn't turn up a full list of BBC feeds (apparently there are a bunch of them), but this appears to be for the main page...

http://news.bbc.co.uk/rss/newsonline_world_edition/front_page/rss091.xml

apparently I never implemented paste (whoops) so you will have to type it into the preferences box in EmpMenuX.

-Mike
Posted by: thinfourth2

Re: Another empeg control widget (for OS X) - 14/10/2003 11:56

yeah you did it does have paste on my powerbook
Posted by: petteri

Re: Another empeg control widget (for OS X) - 12/03/2007 17:28

Dragging thread up from the past here with this question. I've grabbed this great looking app from your site, but it doesn't seem to work on my iMac. In digging aound the package contents when I ran the EmpmenuX exec file I get the following:

Quote:
Last login: Mon Mar 12 15:20:09 on ttyp1
Welcome to Darwin!
/Applications/EmpMenuX.app/Contents/MacOS/EmpMenuX; exit
imac-2:~ tuomasleone$ /Applications/EmpMenuX.app/Contents/MacOS/EmpMenuX; exit
Java for ppc cannot run in this configuration.
Please consult documentation.
-[NSJavaVirtualMachine initWithClassPath:] cannot instantiate a Java virtual machine
2007-03-12 15:26:00.240 EmpMenuX[1967] Unknown class `EmpControl' in nib file, using `NSObject' instead.
2007-03-12 15:26:00.255 EmpMenuX[1967] Could not connect the action save: to target of class NSObject
2007-03-12 15:26:00.257 EmpMenuX[1967] Could not connect the action cancel: to target of class NSObject


I'm guessing that this program won't run under Intel based macs? Looks like a great little app though!
Posted by: kjohanss

Re: Another empeg control widget (for OS X) - 13/03/2007 19:39

Greetings

Lovely applet. It worked on the first go on my mac. The feed viewer is cool, but I have a small challenge for you. In Norway we use some funny looking carachters; ÆØÅ (&aelig; &oslash; &aring;) - and that is not showing in the feed viewer.

Can you fix it?
Posted by: mlord

Re: Another empeg control widget (for OS X) - 13/03/2007 20:13

Quote:
Greetings

Lovely applet. It worked on the first go on my mac. The feed viewer is cool, but I have a small challenge for you. In Norway we use some funny looking carachters; ÆØÅ (&aelig; &oslash; &aring;) - and that is not showing in the feed viewer.

Can you fix it?


I suspect he's using Hijack for the popup message displays, which means the app is limited by Hijack's internal font implementation -- Just standard ASCII chars only.

EDIT: ..which you can examine from the Hijack Menu, under Font Display.
Posted by: petteri

Re: Another empeg control widget (for OS X) - 13/03/2007 21:17

Quote:
Greetings

Lovely applet. It worked on the first go on my mac.


What type of mac are you using?
Posted by: drakino

Re: Another empeg control widget (for OS X) - 14/03/2007 15:27

If you have XCode installed, the source is on the site, and should be compilable into an Intel app. I'm on a PowerPC Mac currently, so I can't compile it here, but I can once I get home. No amount of poking the Intel button in XCode is making an Intel binary for me, might be due to the java code.
Posted by: petteri

Re: Another empeg control widget (for OS X) - 14/03/2007 17:48

Quote:
If you have XCode installed, the source is on the site, and should be compilable into an Intel app. I'm on a PowerPC Mac currently, so I can't compile it here, but I can once I get home. No amount of poking the Intel button in XCode is making an Intel binary for me, might be due to the java code.


Wow! Great all is working now! I haven't compiled a source code since college, where I got a D in the one any only computer class I took. Thanks again!
Posted by: drakino

Re: Another empeg control widget (for OS X) - 14/03/2007 23:18

For anyone else, attached is an Intel version. I may poke at it later to figure out if a universal version is possible.
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 30/01/2008 22:18

Originally Posted By: drakino
For anyone else, attached is an Intel version. I may poke at it later to figure out if a universal version is possible.


Thanks Drakino, I just added your build to my site for posterity.

Boy, I haven't been to this website in a couple years. Howdy, all!

-Mike
Posted by: Robotic

Re: Another empeg control widget (for OS X) - 31/01/2008 00:52

Originally Posted By: mcomb
Boy, I haven't been to this website in a couple years. Howdy, all!

-Mike

Hey Mike! Don't be a stranger!
Posted by: Lupo

Re: Another empeg control widget (for OS X) - 06/11/2012 22:30

Pulling this one out of the grave again...

I tried to install it under Mac OS X 10.6.8 but it doesn't work. I added it to the auto-starting programs in the Users menu; is this correct?
Posted by: mcomb

Re: Another empeg control widget (for OS X) - 10/06/2013 19:35

Originally Posted By: Lupo
Pulling this one out of the grave again...

I tried to install it under Mac OS X 10.6.8 but it doesn't work. I added it to the auto-starting programs in the Users menu; is this correct?


Unfortunately Apple killed off the Java bridge code this used a few OS updates ago so it's sadly incompatible with any somewhat modern OS. About the same I changed jobs and stopped using my empeg at work so I never got around to trying to get something else working.

-Mike