master 95deb647a6c7 cached
16 files
30.4 KB
9.4k tokens
6 symbols
1 requests
Download .txt
Repository: CocoaHeadsBrasil/MuteUnmuteMic
Branch: master
Commit: 95deb647a6c7
Files: 16
Total size: 30.4 KB

Directory structure:
gitextract_87rlpqzd/

├── .gitignore
├── LICENSE
├── README.md
├── [Un]MuteMic/
│   ├── AppDelegate.h
│   ├── AppDelegate.m
│   ├── Assets.xcassets/
│   │   ├── AppIcon.appiconset/
│   │   │   └── Contents.json
│   │   ├── Contents.json
│   │   ├── mic_off.imageset/
│   │   │   └── Contents.json
│   │   └── mic_on.imageset/
│   │       └── Contents.json
│   ├── AudioMixer.c
│   ├── AudioMixer.h
│   ├── Base.lproj/
│   │   └── MainMenu.xib
│   ├── Info.plist
│   └── main.m
└── [Un]MuteMic.xcodeproj/
    ├── project.pbxproj
    └── project.xcworkspace/
        └── contents.xcworkspacedata

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# OS X Finder
.DS_Store

# Xcode per-user config
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
xcuserdata
*.xccheckout

# Build products
build/
*.o
*.LinkFileList
*.hmap

# Automatic backup files
*~.nib/
*.swp
*~
*.dat
*.dep

# Cocoapods
Pods

# AppCode specific files
.idea/
*.iml


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2016 CocoaHeads Brasil

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
<div align="center">
  <img src="https://raw.githubusercontent.com/CocoaHeadsBrasil/MuteUnmuteMic/master/%5BUn%5DMuteMic/Assets.xcassets/AppIcon.appiconset/128.png" width="100" height="100"/>
  <h1>[Un]MuteMic</h1>
  <p align="center">macOS app to mute &amp; unmute the input volume of your microphone. <br/>Perfect for podcasters.</p>
</div>

## Requirements

macOS 10.10 Yosemite or higher version.

## Installation

Download the [latest stable version](https://github.com/CocoaHeadsBrasil/MuteUnmuteMic/releases/download/1.4.2/Un.MuteMic.zip) or clone this repo and build & run.

## Usage

![[Un]MuteMic usage](https://cloud.githubusercontent.com/assets/235208/10419593/143171fc-704a-11e5-8270-374ca898685b.gif)

## Authors

CocoaHeads Brasil: [http://www.cocoaheads.com.br/](http://www.cocoaheads.com.br/)

## License

[The MIT License](https://raw.githubusercontent.com/CocoaHeadsBrasil/MuteUnmuteMic/master/LICENSE)


================================================
FILE: [Un]MuteMic/AppDelegate.h
================================================
//
//  AppDelegate.h
//  MuteUnmuteMic
//
//  Copyright © 2015 CocoaHeads Brasil. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>

@property (weak, nonatomic) IBOutlet NSMenu *menu;

@end



================================================
FILE: [Un]MuteMic/AppDelegate.m
================================================
//
//  AppDelegate.m
//  MuteUnmuteMic
//
//  Copyright © 2015 CocoaHeads Brasil. All rights reserved.
//

#import "AppDelegate.h"
#import "AudioMixer.h"

static NSInteger const kDefaultVolume = 70;

@interface AppDelegate ()

@property (nonatomic) NSStatusItem *menuItem;
@property (nonatomic) BOOL muted;
@property (nonatomic) NSInteger inputVolumeToUnmute;

@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    [self initDefaults];
    [self configureStatusBar];
    [self updateInputVolume];
}

- (void)initDefaults
{
    _muted = IsHardwareMuted();
    _inputVolumeToUnmute = kDefaultVolume;
}

- (void)configureStatusBar
{
    NSStatusBar *statusBar = [NSStatusBar systemStatusBar];
    
    NSStatusItem *menuItem =
    [statusBar statusItemWithLength:NSVariableStatusItemLength];
    [menuItem setToolTip:@"[Un]MuteMic by CocoaHeads Brazil"];
    [menuItem setImage:[NSImage imageNamed:@"mic_on"]];
    [menuItem setHighlightMode:YES];

    [menuItem setTarget:self];
    [menuItem setAction:@selector(menuItemClicked:)];
    [menuItem.button sendActionOn:NSLeftMouseUpMask|NSRightMouseUpMask];
    
    self.menuItem = menuItem;
}

- (void)menuItemClicked:(id)sender
{
    NSEvent *event = [[NSApplication sharedApplication] currentEvent];
    
    if ((event.modifierFlags & NSControlKeyMask) || (event.type == NSRightMouseUp)) {
        [self showMenu];
    } else {
        [self toggleMute];
    }
}

- (void)toggleMute
{
    self.muted = !self.muted;
    [self updateInputVolume];
}

- (void)updateInputVolume
{
    BOOL muted = self.muted;
    
    NSInteger volume;
    NSString *imageName;
    if (muted) {
        volume = 0;
        imageName = @"mic_off";
    } else {
        volume = self.inputVolumeToUnmute;
        imageName = @"mic_on";
    }
    
    // set volume
    NSString *source =
    [NSString stringWithFormat:@"set volume input volume %ld", (long)volume];
    NSAppleScript *script = [[NSAppleScript alloc] initWithSource:source];
    NSDictionary *errorInfo = nil;
    [script executeAndReturnError:&errorInfo];
    
    if (errorInfo) {
        NSLog(@"Error on script %@", errorInfo);
    }
    
    // set hardware mute
    SetHardwareMute(muted);
    
    // set image
    self.menuItem.image = [NSImage imageNamed:imageName];
}

- (void)showMenu
{
    [self.menuItem popUpStatusItemMenu:self.menu];
}

- (IBAction)didSetVolumeInput:(NSMenuItem *)sender
{
    for (NSMenuItem *item in sender.menu.itemArray) {
        item.state = 0;
    }
    sender.state = 1;
    
    self.inputVolumeToUnmute = [sender.title integerValue];
    [self updateInputVolume];
}

@end


================================================
FILE: [Un]MuteMic/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "size" : "16x16",
      "idiom" : "mac",
      "filename" : "16.png",
      "scale" : "1x"
    },
    {
      "size" : "16x16",
      "idiom" : "mac",
      "filename" : "32.png",
      "scale" : "2x"
    },
    {
      "size" : "32x32",
      "idiom" : "mac",
      "filename" : "32.png",
      "scale" : "1x"
    },
    {
      "size" : "32x32",
      "idiom" : "mac",
      "filename" : "64.png",
      "scale" : "2x"
    },
    {
      "size" : "128x128",
      "idiom" : "mac",
      "filename" : "128.png",
      "scale" : "1x"
    },
    {
      "idiom" : "mac",
      "size" : "128x128",
      "filename" : "256.png",
      "scale" : "2x"
    },
    {
      "size" : "256x256",
      "idiom" : "mac",
      "filename" : "256.png",
      "scale" : "1x"
    },
    {
      "idiom" : "mac",
      "size" : "256x256",
      "filename" : "512.png",
      "scale" : "2x"
    },
    {
      "size" : "512x512",
      "idiom" : "mac",
      "filename" : "512.png",
      "scale" : "1x"
    },
    {
      "size" : "512x512",
      "idiom" : "mac",
      "filename" : "1024.png",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}


================================================
FILE: [Un]MuteMic/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

================================================
FILE: [Un]MuteMic/Assets.xcassets/mic_off.imageset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "mac",
      "filename" : "mic_off.png",
      "scale" : "1x"
    },
    {
      "idiom" : "mac",
      "filename" : "mic_off@2x.png",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  },
  "properties" : {
    "template-rendering-intent" : "template"
  }
}

================================================
FILE: [Un]MuteMic/Assets.xcassets/mic_on.imageset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "mac",
      "filename" : "mic_on.png",
      "scale" : "1x"
    },
    {
      "idiom" : "mac",
      "filename" : "mic_on@2x.png",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  },
  "properties" : {
    "template-rendering-intent" : "template"
  }
}

================================================
FILE: [Un]MuteMic/AudioMixer.c
================================================
//
//  AudioMixer.c
//  MuteUnmuteMic
//
//  Created by Diogo Tridapalli on 10/5/15.
//  Copyright © 2015 CocoaHeads Brasil. All rights reserved.
//

#include "AudioMixer.h"

Boolean GetDefaultInputAudioDevice(AudioDeviceID *defaultInputDeviceID)
{
    UInt32 thePropSize = sizeof(AudioDeviceID);
    
    AudioObjectPropertyAddress thePropertyAddress =
    { kAudioHardwarePropertyDefaultInputDevice,
        kAudioObjectPropertyScopeGlobal,
        kAudioObjectPropertyElementMaster };
    
    OSStatus errorCode =
    AudioObjectGetPropertyData(kAudioObjectSystemObject,
                               &thePropertyAddress,
                               0,
                               NULL,
                               &thePropSize,
                               defaultInputDeviceID);
    if (errorCode) {
        printf("Error in GetDefaultInputAudioDevice: %d\n", errorCode);
    }
    
    return errorCode == 0;
}

Boolean GetAudioDeviceName(const AudioDeviceID deviceID,
                           CFStringRef *deviceName)
{
    UInt32 thePropSize = sizeof(CFStringRef);
    AudioObjectPropertyAddress thePropertyAddress =
    { kAudioObjectPropertyName,
        kAudioObjectPropertyScopeGlobal,
        kAudioObjectPropertyElementMaster };
    
    OSStatus errorCode =
    AudioObjectGetPropertyData(deviceID,
                               &thePropertyAddress,
                               0,
                               NULL,
                               &thePropSize,
                               deviceName);
    
    if (errorCode) {
        printf("Error in GetAudioDeviceName: %d\n", errorCode);
    }
    
    return errorCode == 0;
}

Boolean GetMuteOnInputAudioDevice(const AudioDeviceID inputDeviceID,
                                  Boolean *isMuted)
{
    AudioObjectPropertyAddress thePropertyAddress =
    { kAudioDevicePropertyMute,
        kAudioDevicePropertyScopeInput,
        kAudioObjectPropertyElementMaster };
    
    UInt32 mute = 0;
    UInt32 thePropSize = sizeof(mute);
    
    OSStatus errorCode;
    if (AudioObjectHasProperty(inputDeviceID, &thePropertyAddress)) {
        errorCode = AudioObjectGetPropertyData(inputDeviceID,
                                               &thePropertyAddress,
                                               0,
                                               NULL,
                                               &thePropSize,
                                               &mute);
        if (errorCode) {
            printf("Error in GetMuteOnInputAudioDevice: %d\n", errorCode);
        }
        
        *isMuted = mute > 0;
        
        return errorCode == 0;
    } else {
        printf("Error in GetMuteOnInputAudioDevice: mute not supported\n");
        
        return false;
    }
}

Boolean SetMuteOnInputAudioDevice(const AudioDeviceID inputDeviceID,
                                  const Boolean mute)
{
    AudioObjectPropertyAddress thePropertyAddress =
    { kAudioDevicePropertyMute,
        kAudioDevicePropertyScopeInput,
        kAudioObjectPropertyElementMaster };
    
    UInt32 theMute = mute;
    UInt32 thePropSize = sizeof(theMute);
    
    
    const char *inputDeviceString;
    CFStringRef inputDeviceName;
    if (GetAudioDeviceName(inputDeviceID, &inputDeviceName)) {
        inputDeviceString =
        CFStringGetCStringPtr(inputDeviceName, CFStringGetSystemEncoding());
        CFRelease(inputDeviceName);
    } else {
        inputDeviceString = "<Unamed device>";
    }
    
    Boolean setMute = true;
    
    if (AudioObjectHasProperty(inputDeviceID, &thePropertyAddress)) {
        printf("\tSetting %s mute %s\n", inputDeviceString, (theMute) ? "on" : "off");
        OSStatus errorCode = AudioObjectSetPropertyData(inputDeviceID,
                                                        &thePropertyAddress,
                                                        0,
                                                        NULL,
                                                        thePropSize,
                                                        &theMute);
        if (errorCode) {
            printf("Error in SetMuteOnInputAudioDevice: %d\n", errorCode);
            setMute = false;
        }
    } else {
        printf("Error in SetMuteOnInputAudioDevice: mute not supported\n");
        setMute = false;
    }
    
    return setMute;
}

Boolean IsHardwareMuted()
{
    AudioDeviceID theDefaultInputDeviceID;
    
    Boolean isMuted = false;
    
    if (GetDefaultInputAudioDevice(&theDefaultInputDeviceID)) {
        GetMuteOnInputAudioDevice(theDefaultInputDeviceID, &isMuted);
    }
    
    return isMuted;
}

void SetHardwareMute(Boolean theMute)
{
    AudioDeviceID theDefaultInputDeviceID;
    if (GetDefaultInputAudioDevice(&theDefaultInputDeviceID)) {
        SetMuteOnInputAudioDevice(theDefaultInputDeviceID, theMute);
    }
}

================================================
FILE: [Un]MuteMic/AudioMixer.h
================================================
//
//  AudioMixer.h
//  MuteUnmuteMic
//
//  Created by Diogo Tridapalli on 10/5/15.
//  Copyright © 2015 CocoaHeads Brasil. All rights reserved.
//

#ifndef AudioMixer_h
#define AudioMixer_h

#import <CoreAudio/CoreAudio.h>
/**
 *  Get device id for the default input device
 *
 *  @param defaultInputDeviceID AudioDeviceID pointer
 *
 *  @return @a true if success @a false otherwise
 */
extern Boolean GetDefaultInputAudioDevice(AudioDeviceID *defaultInputDeviceID);

/**
 *  Get the name of an audio device
 *
 *  @param deviceID               AudioDeviceID
 *  @param deviceName CFStringRef reference, must be release after use
 *
 *  @return @a true if success @a false otherwise
 */
extern Boolean GetAudioDeviceName(const AudioDeviceID deviceID,
                                  CFStringRef *deviceName);

/**
 *  Get mute state on input device
 *
 *  @param inputDeviceID AudioDeviceID
 *  @param isMuted       @a true if device is muted @a false otherwise
 *
 *  @return @a true if success @a false otherwise
 */
extern Boolean GetMuteOnInputAudioDevice(const AudioDeviceID inputDeviceID,
                                         Boolean *isMuted);

/**
 *  Mute or unmute an inpute device
 *
 *  @param inputDeviceID AudioDeviceID
 *  @param mute          @a true if device should be muted @a false otherwise
 *
 *  @return @a true if success @a false otherwise
 */
extern Boolean SetMuteOnInputAudioDevice(const AudioDeviceID inputDeviceID,
                                         const Boolean mute);

/**
 *  Get the mute state of default input via HAL
 *
 *  @return @a true if is muted @a false otherwise
 */
extern Boolean IsHardwareMuted();

/**
 *  Set the mute state of default input via HAL
 *
 *  @param theMute @a true if should be muted @a false otherwise
 */
extern void SetHardwareMute(Boolean theMute);

#endif /* AudioMixer_h */


================================================
FILE: [Un]MuteMic/Base.lproj/MainMenu.xib
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9046" systemVersion="14E46" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9046"/>
    </dependencies>
    <objects>
        <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
            <connections>
                <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
            </connections>
        </customObject>
        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
        <customObject id="Voe-Tx-rLC" customClass="AppDelegate">
            <connections>
                <outlet property="menu" destination="d1i-xa-wlo" id="2UA-gw-tWj"/>
            </connections>
        </customObject>
        <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
        <menu id="d1i-xa-wlo">
            <items>
                <menuItem title="Input Volume" id="w4W-DI-DEg">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="Input Volume" autoenablesItems="NO" id="iVL-f8-mAL">
                        <items>
                            <menuItem title="100" id="NOm-DS-Fei">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="didSetVolumeInput:" target="Voe-Tx-rLC" id="I1n-CB-cYw"/>
                                </connections>
                            </menuItem>
                            <menuItem title="90" tag="5" id="cSh-2l-eG8">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="didSetVolumeInput:" target="Voe-Tx-rLC" id="b1z-78-Fgk"/>
                                </connections>
                            </menuItem>
                            <menuItem title="80" tag="5" id="OoN-lP-2Ll">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="didSetVolumeInput:" target="Voe-Tx-rLC" id="itM-AQ-plW"/>
                                </connections>
                            </menuItem>
                            <menuItem title="70" state="on" id="ZNu-ZY-zwa">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="didSetVolumeInput:" target="Voe-Tx-rLC" id="Ykp-jU-4Cw"/>
                                </connections>
                            </menuItem>
                            <menuItem title="60" id="XY7-OS-7P1">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="didSetVolumeInput:" target="Voe-Tx-rLC" id="dqL-Vx-3KL"/>
                                </connections>
                            </menuItem>
                            <menuItem title="50" id="MrJ-HJ-Wld">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="didSetVolumeInput:" target="Voe-Tx-rLC" id="PVQ-c8-lcy"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem isSeparatorItem="YES" id="e5f-y4-vmV"/>
                <menuItem title="Quit" id="kX5-as-WCF">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <connections>
                        <action selector="terminate:" target="-1" id="yi0-uA-sG0"/>
                    </connections>
                </menuItem>
            </items>
            <connections>
                <outlet property="delegate" destination="Voe-Tx-rLC" id="30G-NN-Naz"/>
            </connections>
            <point key="canvasLocation" x="-268" y="-315.5"/>
        </menu>
    </objects>
</document>


================================================
FILE: [Un]MuteMic/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIconFile</key>
	<string></string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.4.2</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>5</string>
	<key>LSApplicationCategoryType</key>
	<string>public.app-category.utilities</string>
	<key>LSMinimumSystemVersion</key>
	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
	<key>LSUIElement</key>
	<true/>
	<key>NSHumanReadableCopyright</key>
	<string>Copyright © 2015 CocoaHeads Brasil. All rights reserved.</string>
	<key>NSMainNibFile</key>
	<string>MainMenu</string>
	<key>NSPrincipalClass</key>
	<string>NSApplication</string>
</dict>
</plist>


================================================
FILE: [Un]MuteMic/main.m
================================================
#import <Cocoa/Cocoa.h>

int main(int argc, const char * argv[]) {
    return NSApplicationMain(argc, argv);
}


================================================
FILE: [Un]MuteMic.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 46;
	objects = {

/* Begin PBXBuildFile section */
		D9A9F66F1BC35EDC004395E8 /* AudioMixer.c in Sources */ = {isa = PBXBuildFile; fileRef = D9A9F66D1BC35EDC004395E8 /* AudioMixer.c */; };
		ECF208BE1BAF2DE6000D3C2C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ECF208BD1BAF2DE6000D3C2C /* AppDelegate.m */; };
		ECF208C11BAF2DE6000D3C2C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ECF208C01BAF2DE6000D3C2C /* main.m */; };
		ECF208C31BAF2DE6000D3C2C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECF208C21BAF2DE6000D3C2C /* Assets.xcassets */; };
		ECF208C61BAF2DE6000D3C2C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = ECF208C41BAF2DE6000D3C2C /* MainMenu.xib */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		D9A9F66D1BC35EDC004395E8 /* AudioMixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AudioMixer.c; path = "[Un]MuteMic/AudioMixer.c"; sourceTree = "<group>"; };
		D9A9F66E1BC35EDC004395E8 /* AudioMixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioMixer.h; path = "[Un]MuteMic/AudioMixer.h"; sourceTree = "<group>"; };
		ECF208B91BAF2DE6000D3C2C /* [Un]MuteMic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "[Un]MuteMic.app"; sourceTree = BUILT_PRODUCTS_DIR; };
		ECF208BC1BAF2DE6000D3C2C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
		ECF208BD1BAF2DE6000D3C2C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
		ECF208C01BAF2DE6000D3C2C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
		ECF208C21BAF2DE6000D3C2C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		ECF208C51BAF2DE6000D3C2C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
		ECF208C71BAF2DE6000D3C2C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		ECF208B61BAF2DE6000D3C2C /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		D9A9F6701BC5830F004395E8 /* AudioMixer */ = {
			isa = PBXGroup;
			children = (
				D9A9F66D1BC35EDC004395E8 /* AudioMixer.c */,
				D9A9F66E1BC35EDC004395E8 /* AudioMixer.h */,
			);
			name = AudioMixer;
			path = ..;
			sourceTree = "<group>";
		};
		ECF208B01BAF2DE6000D3C2C = {
			isa = PBXGroup;
			children = (
				ECF208BB1BAF2DE6000D3C2C /* [Un]MuteMic */,
				ECF208BA1BAF2DE6000D3C2C /* Products */,
			);
			sourceTree = "<group>";
		};
		ECF208BA1BAF2DE6000D3C2C /* Products */ = {
			isa = PBXGroup;
			children = (
				ECF208B91BAF2DE6000D3C2C /* [Un]MuteMic.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		ECF208BB1BAF2DE6000D3C2C /* [Un]MuteMic */ = {
			isa = PBXGroup;
			children = (
				ECF208BC1BAF2DE6000D3C2C /* AppDelegate.h */,
				ECF208BD1BAF2DE6000D3C2C /* AppDelegate.m */,
				ECF208C21BAF2DE6000D3C2C /* Assets.xcassets */,
				ECF208C41BAF2DE6000D3C2C /* MainMenu.xib */,
				ECF208C71BAF2DE6000D3C2C /* Info.plist */,
				ECF208BF1BAF2DE6000D3C2C /* Supporting Files */,
				D9A9F6701BC5830F004395E8 /* AudioMixer */,
			);
			path = "[Un]MuteMic";
			sourceTree = "<group>";
		};
		ECF208BF1BAF2DE6000D3C2C /* Supporting Files */ = {
			isa = PBXGroup;
			children = (
				ECF208C01BAF2DE6000D3C2C /* main.m */,
			);
			name = "Supporting Files";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		ECF208B81BAF2DE6000D3C2C /* [Un]MuteMic */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = ECF208CA1BAF2DE6000D3C2C /* Build configuration list for PBXNativeTarget "[Un]MuteMic" */;
			buildPhases = (
				ECF208B51BAF2DE6000D3C2C /* Sources */,
				ECF208B61BAF2DE6000D3C2C /* Frameworks */,
				ECF208B71BAF2DE6000D3C2C /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = "[Un]MuteMic";
			productName = MuteUnmuteMic;
			productReference = ECF208B91BAF2DE6000D3C2C /* [Un]MuteMic.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		ECF208B11BAF2DE6000D3C2C /* Project object */ = {
			isa = PBXProject;
			attributes = {
				LastUpgradeCheck = 0700;
				ORGANIZATIONNAME = "CocoaHeads Brasil";
				TargetAttributes = {
					ECF208B81BAF2DE6000D3C2C = {
						CreatedOnToolsVersion = 7.0;
					};
				};
			};
			buildConfigurationList = ECF208B41BAF2DE6000D3C2C /* Build configuration list for PBXProject "[Un]MuteMic" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = ECF208B01BAF2DE6000D3C2C;
			productRefGroup = ECF208BA1BAF2DE6000D3C2C /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				ECF208B81BAF2DE6000D3C2C /* [Un]MuteMic */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		ECF208B71BAF2DE6000D3C2C /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				ECF208C31BAF2DE6000D3C2C /* Assets.xcassets in Resources */,
				ECF208C61BAF2DE6000D3C2C /* MainMenu.xib in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		ECF208B51BAF2DE6000D3C2C /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				ECF208C11BAF2DE6000D3C2C /* main.m in Sources */,
				ECF208BE1BAF2DE6000D3C2C /* AppDelegate.m in Sources */,
				D9A9F66F1BC35EDC004395E8 /* AudioMixer.c in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
		ECF208C41BAF2DE6000D3C2C /* MainMenu.xib */ = {
			isa = PBXVariantGroup;
			children = (
				ECF208C51BAF2DE6000D3C2C /* Base */,
			);
			name = MainMenu.xib;
			sourceTree = "<group>";
		};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
		ECF208C81BAF2DE6000D3C2C /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				CODE_SIGN_IDENTITY = "-";
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.10;
				MTL_ENABLE_DEBUG_INFO = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = macosx;
			};
			name = Debug;
		};
		ECF208C91BAF2DE6000D3C2C /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				CODE_SIGN_IDENTITY = "-";
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.10;
				MTL_ENABLE_DEBUG_INFO = NO;
				SDKROOT = macosx;
			};
			name = Release;
		};
		ECF208CB1BAF2DE6000D3C2C /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				COMBINE_HIDPI_IMAGES = YES;
				INFOPLIST_FILE = "[Un]MuteMic/Info.plist";
				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
				PRODUCT_BUNDLE_IDENTIFIER = br.com.cocoaheads.MuteUnmuteMic;
				PRODUCT_NAME = "[Un]MuteMic";
			};
			name = Debug;
		};
		ECF208CC1BAF2DE6000D3C2C /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				COMBINE_HIDPI_IMAGES = YES;
				INFOPLIST_FILE = "[Un]MuteMic/Info.plist";
				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
				PRODUCT_BUNDLE_IDENTIFIER = br.com.cocoaheads.MuteUnmuteMic;
				PRODUCT_NAME = "[Un]MuteMic";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		ECF208B41BAF2DE6000D3C2C /* Build configuration list for PBXProject "[Un]MuteMic" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				ECF208C81BAF2DE6000D3C2C /* Debug */,
				ECF208C91BAF2DE6000D3C2C /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		ECF208CA1BAF2DE6000D3C2C /* Build configuration list for PBXNativeTarget "[Un]MuteMic" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				ECF208CB1BAF2DE6000D3C2C /* Debug */,
				ECF208CC1BAF2DE6000D3C2C /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */
	};
	rootObject = ECF208B11BAF2DE6000D3C2C /* Project object */;
}


================================================
FILE: [Un]MuteMic.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "self:[Un]MuteMic.xcodeproj">
   </FileRef>
</Workspace>
Download .txt
gitextract_87rlpqzd/

├── .gitignore
├── LICENSE
├── README.md
├── [Un]MuteMic/
│   ├── AppDelegate.h
│   ├── AppDelegate.m
│   ├── Assets.xcassets/
│   │   ├── AppIcon.appiconset/
│   │   │   └── Contents.json
│   │   ├── Contents.json
│   │   ├── mic_off.imageset/
│   │   │   └── Contents.json
│   │   └── mic_on.imageset/
│   │       └── Contents.json
│   ├── AudioMixer.c
│   ├── AudioMixer.h
│   ├── Base.lproj/
│   │   └── MainMenu.xib
│   ├── Info.plist
│   └── main.m
└── [Un]MuteMic.xcodeproj/
    ├── project.pbxproj
    └── project.xcworkspace/
        └── contents.xcworkspacedata
Download .txt
SYMBOL INDEX (6 symbols across 1 files)

FILE: [Un]MuteMic/AudioMixer.c
  function Boolean (line 11) | Boolean GetDefaultInputAudioDevice(AudioDeviceID *defaultInputDeviceID)
  function Boolean (line 34) | Boolean GetAudioDeviceName(const AudioDeviceID deviceID,
  function Boolean (line 58) | Boolean GetMuteOnInputAudioDevice(const AudioDeviceID inputDeviceID,
  function Boolean (line 91) | Boolean SetMuteOnInputAudioDevice(const AudioDeviceID inputDeviceID,
  function Boolean (line 135) | Boolean IsHardwareMuted()
  function SetHardwareMute (line 148) | void SetHardwareMute(Boolean theMute)
Condensed preview — 16 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (35K chars).
[
  {
    "path": ".gitignore",
    "chars": 304,
    "preview": "# OS X Finder\n.DS_Store\n\n# Xcode per-user config\n*.mode1\n*.mode1v3\n*.mode2v3\n*.perspective\n*.perspectivev3\n*.pbxuser\nxcu"
  },
  {
    "path": "LICENSE",
    "chars": 1084,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2016 CocoaHeads Brasil\n\nPermission is hereby granted, free of charge, to any person"
  },
  {
    "path": "README.md",
    "chars": 922,
    "preview": "<div align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/CocoaHeadsBrasil/MuteUnmuteMic/master/%5BUn%5DMuteMic"
  },
  {
    "path": "[Un]MuteMic/AppDelegate.h",
    "chars": 249,
    "preview": "//\n//  AppDelegate.h\n//  MuteUnmuteMic\n//\n//  Copyright © 2015 CocoaHeads Brasil. All rights reserved.\n//\n\n#import <Coco"
  },
  {
    "path": "[Un]MuteMic/AppDelegate.m",
    "chars": 2665,
    "preview": "//\n//  AppDelegate.m\n//  MuteUnmuteMic\n//\n//  Copyright © 2015 CocoaHeads Brasil. All rights reserved.\n//\n\n#import \"AppD"
  },
  {
    "path": "[Un]MuteMic/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 1201,
    "preview": "{\n  \"images\" : [\n    {\n      \"size\" : \"16x16\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"16.png\",\n      \"scale\" : \"1x\"\n"
  },
  {
    "path": "[Un]MuteMic/Assets.xcassets/Contents.json",
    "chars": 62,
    "preview": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "[Un]MuteMic/Assets.xcassets/mic_off.imageset/Contents.json",
    "chars": 335,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"mac\",\n      \"filename\" : \"mic_off.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      "
  },
  {
    "path": "[Un]MuteMic/Assets.xcassets/mic_on.imageset/Contents.json",
    "chars": 333,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"mac\",\n      \"filename\" : \"mic_on.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \""
  },
  {
    "path": "[Un]MuteMic/AudioMixer.c",
    "chars": 4898,
    "preview": "//\n//  AudioMixer.c\n//  MuteUnmuteMic\n//\n//  Created by Diogo Tridapalli on 10/5/15.\n//  Copyright © 2015 CocoaHeads Bra"
  },
  {
    "path": "[Un]MuteMic/AudioMixer.h",
    "chars": 1859,
    "preview": "//\n//  AudioMixer.h\n//  MuteUnmuteMic\n//\n//  Created by Diogo Tridapalli on 10/5/15.\n//  Copyright © 2015 CocoaHeads Bra"
  },
  {
    "path": "[Un]MuteMic/Base.lproj/MainMenu.xib",
    "chars": 4549,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3"
  },
  {
    "path": "[Un]MuteMic/Info.plist",
    "chars": 1209,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "[Un]MuteMic/main.m",
    "chars": 111,
    "preview": "#import <Cocoa/Cocoa.h>\n\nint main(int argc, const char * argv[]) {\n    return NSApplicationMain(argc, argv);\n}\n"
  },
  {
    "path": "[Un]MuteMic.xcodeproj/project.pbxproj",
    "chars": 11143,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "[Un]MuteMic.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 156,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:[Un]MuteMic.xco"
  }
]

About this extraction

This page contains the full source code of the CocoaHeadsBrasil/MuteUnmuteMic GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 16 files (30.4 KB), approximately 9.4k tokens, and a symbol index with 6 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!