usbdmx.com Home of the opto isolated, bus powered, DMX512 interface with both in and out universes. Cheap and simple to build. USBDMX logo

LOFixtureLibrary Class Reference

An object to manage a collection of fixture definitions. More...

#import <LOFixtureLibrary.h>


Public Member Functions

(id) - initWithDelegate:
 Initlise the library with a delegate.
(id) - delegate
 Get the current delegate.
(void) - setDelegate:
 Set a new delegate object.
(NSXMLElement *) - exportLibraryXML
 Export all fixture definitions into a single XML object.
(NSXMLElement *) - exportLibraryXMLForManufacturer:
 Export all fixture definitions belonging to a specific manufacturer into a single XML object.
(BOOL) - importFixtureXML:
 Import a fixture XML definition.
(int) - importLibraryXML:
 Import multiple fixtures.
(LOFixture *) - fixtureNamed:fromManufacturer:
 Get a new instance of a fixture from the library.
(LOFixture *) - fixtureMatching:
 Return the first fixture found in the library with the same attributes as theFixture.
(LOFixture *) - fixtureMatchingXML:
 Return the first fixture found in the library with the same attributes as theFixture.
(NSArray *) - manufacturers
 Get an array of manufacturer names held in the library.
(NSArray *) - namesForManufacturer:
 All the fixture names in the library for a given manufacturer;.
(NSString *) - commentForFixtureNamed:fromManufacturer:
 Get the comment for the fixture with name and manufacturer.
(LOFixture *) - fixtureSelectedInBrowser:
 Get the fixture selected in the NSBrowser.
(NSString *) - searchFilter
 Get the current search filter.
(void) - setSearchFilter:
 Set the current serach filter, set to empty string or nil to remove the filter.
(void) - filter
 Filter the results based on the searchFilter.

Static Public Member Functions

(LOFixtureLibrary *) + defaultLibrary
 Get the default Fixture Library for the applications.

Protected Attributes

NSMutableDictionary * manufacturers
 A hash of all the menufacturers.
NSMutableArray * sortedManufacturers
 An array of manufactures, sorted alphabetically.
NSMutableArray * allFixtures
 Array of all fixtures, sorted alphabetically by fixture name.
id delegate
 The delegate object.
NSString * searchFilter
 A search filter to narrow down the fixtures displayed in the NSBrowser.
NSArray * filteredAllFixtures
 A filtered version of the allFixtures array.
NSArray * filteredManufacturers
 A filtered list of manufacturer names.


Detailed Description

An object to manage a collection of fixture definitions.

This allows multiple fixtures to be loaded from a single XML file and multiple fixture files, de-duping and automatically renaming non duplicates with identical names.

This library object can be used as an NSBrowser delegate to populate a browser.


Member Function Documentation

- (NSString *) commentForFixtureNamed: (NSString *)  name
fromManufacturer: (NSString *)  manufacturer 

Get the comment for the fixture with name and manufacturer.

Returns:
The comment or nil if no fixture.

+ (LOFixtureLibrary *) defaultLibrary  

Get the default Fixture Library for the applications.

Returns:
The current applications default fixture library.

- (id) delegate  

Get the current delegate.

Returns:
The delegate object
See also:
- setDelegate:

NSObject(LOFixtureLibraryDelegate) in LOFixtureLibrary.h

- (NSXMLElement *) exportLibraryXML  

Export all fixture definitions into a single XML object.

See also:
- exportLibraryXMLForManufacturer:

- (NSXMLElement *) exportLibraryXMLForManufacturer: (NSString *)  theManufacturer  

Export all fixture definitions belonging to a specific manufacturer into a single XML object.

See also:
- exportLibraryXML

- (void) filter  

Filter the results based on the searchFilter.

This function is automatically called from setSearchFilter: so there is never any need to call it directly

- (LOFixture *) fixtureMatching: (LOFixture *)  theFixture  

Return the first fixture found in the library with the same attributes as theFixture.

The name and manufacturers names are not checked. The comment field is also ignored for the purposes of finding a matching fixture.

See also:
- fixtureMatchingXML:

- (LOFixture *) fixtureMatchingXML: (NSXMLElement *)  XMLElement  

Return the first fixture found in the library with the same attributes as theFixture.

The name and manufacturers names are not checked. The comment field is also ignored for the purposes of finding a matching fixture.

See also:
- fixtureMatching:

- (LOFixture *) fixtureNamed: (NSString *)  name
fromManufacturer: (NSString *)  manufacturer 

Get a new instance of a fixture from the library.

Returns:
the fixture, or nil if no fixture exists in the library.

- (LOFixture *) fixtureSelectedInBrowser: (NSBrowser *)  browser  

Get the fixture selected in the NSBrowser.

This can only be used if the browser uses this FixtureLibrary as its delegate

- (BOOL) importFixtureXML: (NSXMLElement *)  XMLElement  

Import a fixture XML definition.

The format of a single fixture file follows that of a stndard fixture definition :

  <fixture manufacturer="" name="">
  ...
  </fixture>

See also:
- importLibraryXML:

initWithXML:

- (int) importLibraryXML: (NSXMLElement *)  XMLElement  

Import multiple fixtures.

A library file contains multiple fixtures :

  <fixtures>
   <fixture manufacturer="" name="">
   ...
   </fixture>
  </fixtures>

See also:
- importFixtureXML:

initWithXML:

Returns:
The number of fixtures imported

- (id) initWithDelegate: (id)  aDelegate  

Initlise the library with a delegate.

See also:
- setDelegate:

- (NSArray *) manufacturers  

Get an array of manufacturer names held in the library.

Returns:
Array of NSStrings containing the manufacturer names

- (NSArray *) namesForManufacturer: (NSString *)  manufacturer  

All the fixture names in the library for a given manufacturer;.

Returns:
Array of NSStrings containing the fixture names

- (NSString *) searchFilter  

Get the current search filter.

See also:
- setSearchFilter:

- (void) setDelegate: (id)  aDelegate  

Set a new delegate object.

Parameters:
aDelegate The object to receive all delegate messages
See also:
delegate:

NSObject(LOFixtureLibraryDelegate) in LOFixtureLibrary.h

- (void) setSearchFilter: (NSString *)  search  

Set the current serach filter, set to empty string or nil to remove the filter.

See also:
searchFilter


The documentation for this class was generated from the following files: