Skip to content

Commit

Permalink
Cosmetic refactoring
Browse files Browse the repository at this point in the history
- Update copyright header
- Remove unused function
  • Loading branch information
gonzoua committed May 1, 2016
1 parent 44b079b commit 7bf67e2
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 37 deletions.
35 changes: 27 additions & 8 deletions MetaEditor.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
/*
* MetaEditor.h
* AudioBookBinder
*
* Created by Oleksandr Tymoshenko on 10-06-09.
* Copyright 2010 Bluezbox Software. All rights reserved.
*
*/
//
// Copyright (c) 2010-2016 Oleksandr Tymoshenko <[email protected]>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice unmodified, this list of conditions, and the following
// disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//

#ifndef __METAEDITOR__
#define __METAEDITOR__

Expand Down
56 changes: 27 additions & 29 deletions MetaEditor.mm
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
/*
* MetaEditor.cpp
* AudioBookBinder
*
* Created by Oleksandr Tymoshenko on 10-06-09.
* Copyright 2010 Bluezbox Software. All rights reserved.
*
*/
//
// Copyright (c) 2010-2016 Oleksandr Tymoshenko <[email protected]>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice unmodified, this list of conditions, and the following
// disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//

extern "C" {
#include "MetaEditor.h"
};

#include <vector>
#include <mp4v2/mp4v2.h>
#import "Chapter.h"

using namespace std;

extern "C" int setBookInfo(const char *mp4, const char *author, const char *title)
{
MP4FileHandle h = MP4Modify( mp4 );
fprintf( stderr, "Begin\n");
if ( h == MP4_INVALID_FILE_HANDLE ) {
fprintf( stderr, "Could not open '%s'... aborting\n", mp4 );
return -1;
}
/* Read out the existing metadata */
const MP4Tags* mdata = MP4TagsAlloc();
MP4TagsFetch(mdata, h);
MP4TagsSetArtist(mdata, author);
/* Write out all tag modifications, free and close */
MP4TagsStore( mdata, h );
MP4TagsFree( mdata );
MP4Close( h );
fprintf( stderr, "Done\n");

return 0;
}

int addChapters(const char *mp4, NSArray *chapters)
{
MP4FileHandle h = MP4Modify( mp4 );
Expand Down

0 comments on commit 7bf67e2

Please sign in to comment.