Permalink
Browse files

Delete trailing whitespaces

  • Loading branch information...
1 parent c723e7c commit a167776a585e267d76789d4bc47bf0b47e733f1f @rumpl committed May 15, 2011
Showing with 18 additions and 17 deletions.
  1. +15 −14 naudio.cc
  2. +3 −3 naudio.h
View
29 naudio.cc
@@ -3,7 +3,8 @@
using namespace v8;
using namespace node;
-struct play_request {
+struct play_request
+{
char* file;
Persistent<Function> cb;
};
@@ -22,12 +23,12 @@ void Naudio::Init(Handle<Object> target)
target->Set(String::NewSymbol("Naudio"), s_ct->GetFunction());
}
-Handle<Value> Naudio::New(const Arguments& args)
+Handle<Value> Naudio::New(const Arguments& args)
{
HandleScope scope;
Naudio *naudio = new Naudio();
naudio->Wrap(args.This());
- return args.This();
+ return args.This();
}
Handle<Value> Naudio::Play(const Arguments& args)
@@ -38,15 +39,15 @@ Handle<Value> Naudio::Play(const Arguments& args)
{
return ThrowException(Exception::Error(String::New("First argument must be a string")));
}
-
+
if (args.Length() == 0 || !args[1]->IsFunction())
{
return ThrowException(Exception::Error(String::New("Second argument must be a function")));
}
Local<Function> cb = Local<Function>::Cast(args[1]);
String::Utf8Value input(args[0]->ToString());
-
+
play_request *pr = new play_request();
pr->file = strdup(*input);
pr->cb = Persistent<Function>::New(cb);
@@ -72,7 +73,7 @@ void Naudio::WaitEnd(libvlc_media_player_t *mp)
{
libvlc_state_t state;
do {
- state = libvlc_media_player_get_state (mp);
+ state = libvlc_media_player_get_state (mp);
usleep(100000);
} while(state != libvlc_Error &&
state != libvlc_Ended );
@@ -93,25 +94,25 @@ int Naudio::EIO_Play(eio_req *req)
}
else
{
- m = libvlc_media_new_path (inst, pr->file);
+ m = libvlc_media_new_path (inst, pr->file);
}
-
+
mp = libvlc_media_player_new_from_media (m);
libvlc_media_release (m);
libvlc_media_player_play (mp);
-
+
Naudio::WaitPlaying(mp);
-
+
Naudio::WaitEnd(mp);
libvlc_media_player_stop (mp);
-
+
libvlc_media_player_release (mp);
-
+
libvlc_release (inst);
-
+
return 0;
}
@@ -125,7 +126,7 @@ int Naudio::EIO_PlayAfter(eio_req *req)
argv[0] = Local<Value>::New(Null());
pr->cb->Call(Context::GetCurrent()->Global(), 0, argv);
- if (try_catch.HasCaught())
+ if (try_catch.HasCaught())
{
FatalException(try_catch);
}
View
6 naudio.h
@@ -10,7 +10,7 @@
using namespace v8;
using namespace node;
-class Naudio : public node::ObjectWrap
+class Naudio : public node::ObjectWrap
{
public:
static Persistent<FunctionTemplate> s_ct;
@@ -21,7 +21,7 @@ class Naudio : public node::ObjectWrap
static void WaitPlaying(libvlc_media_player_t *mp);
static void WaitEnd(libvlc_media_player_t *mp);
static Handle<Value> Play(const Arguments& args);
-
+
static int EIO_PlayAfter(eio_req *req);
- static int EIO_Play(eio_req *req);
+ static int EIO_Play(eio_req *req);
};

0 comments on commit a167776

Please sign in to comment.